flutter_html_css_stylesheet 0.2.0 copy "flutter_html_css_stylesheet: ^0.2.0" to clipboard
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_extension on 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_html 3.0.0 does read <style> blocks, then hands every declaration to declarationsToStyle(), 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 inline style="" at the preStyling step, 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.
  • consumeStyleElements defaults to true and empties each <style> element once it has been read. Not tidiness: upstream parseExternalCss() throws a LateInitializationError on @media and a TypeError on @keyframes with nothing of ours registered, and emptying the block is what keeps it away from them.
  • onUnsupportedRule names 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.
0
likes
160
points
47
downloads

Documentation

API reference

Publisher

verified publisherchaosworld.cc

Weekly Downloads

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.

Repository (GitLab)
View/report issues
Contributing

Topics

#flutter-html #css #html #extension #stylesheet

License

MPL-2.0 (license)

Dependencies

csslib, flutter, flutter_html, html

More

Packages that depend on flutter_html_css_stylesheet