flutter_html_css_stylesheet 0.2.0
flutter_html_css_stylesheet: ^0.2.0 copied to clipboard
A flutter_html extension that resolves a CSS stylesheet and writes each element's winning declarations into its inline style, so extensions can read them.
0.2.0 #
- Renamed from
flutter_html_css_stylesheet_extensionon pub.flutter-io.cn. The old package stays published and is marked discontinued with this one as its replacement. Class names are unchanged.
0.1.0 #
- Initial release.
flutter_html3.0.0 does read<style>blocks, then hands every declaration todeclarationsToStyle(), which knows 51 property names and drops the rest before any extension runs, so a stylesheet rule could never reach the family. This one resolves the cascade itself and appends each element's winning declarations to its inlinestyle=""at thepreStylingstep, where the siblings already look. Register it first or they read the attribute before the rules land in it. - Selectors go through
StyledElement.matchesSelector, so you get type, class, id, attribute and:not()selectors plus all four combinators, and not much else. The selector reference has the tables. consumeStyleElementsdefaults to true and empties each<style>element once it has been read. Not tidiness: upstreamparseExternalCss()throws aLateInitializationErroron@mediaand aTypeErroron@keyframeswith nothing of ours registered, and emptying the block is what keeps it away from them.onUnsupportedRulenames every rule that renders nothing: at-rules, pseudo-elements, and any pseudo-class the matcher cannot evaluate. Leave it off and they go in silence, which is the failure mode this package will get blamed for.