flutter_html_class_to_css 0.2.0
flutter_html_class_to_css: ^0.2.0 copied to clipboard
Plumbing for flutter_html extensions that translate an element's class attribute into inline CSS.
0.2.0 #
- Renamed from
flutter_html_class_to_css_converter_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.1 #
- New diagnostic: an element whose classes a resolver claimed, on a tag
flutter_html3.0.0 cannot render, is now named once per parsed document throughFlutterError.reportError. Reported, never thrown, same channel as the sibling packages' unsupported-class reports. Silence it withreportUnrenderableTags: falseon the constructor. - Why this needed a diagnostic at all:
flutter_htmlrenders an element only if something claims it at thepreparingstep. If nothing does,prepareFromExtensionreturns anEmptyContentElementand the element and its whole subtree render nothing, with no error and no warning. Inlining CSS onto that element changes nothing.table,video,audio,iframe,input,svg,mathand every custom element likev-cardare all in that bucket. reportUnrenderableTagsis a separate flag from a subclass's own unsupported-class report on purpose. The class report fires on ordinary markup and gets silenced as routine noise; this one fires only when a subtree vanishes. One flag for both would let the loud report silence the quiet one.- The report stays quiet once you register a
TagExtensionfor the tag. It re-runsprepareFromExtension's own check against the registered extensions rather than trusting a static list, so doing the fix it asks for actually turns it off. - New public API:
kFlutterHtmlRenderableTags(the 70 tagsflutter_html3.0.0's built-ins claim),isFlutterHtmlRenderableTag,UnrenderableTagsException,UnrenderableTagReporter,ClassToInlineCssExtension.recordUnrenderableTagfor subclasses that overridebeforeStyle, anddebugResetUnrenderableTagReportingfor tests. The tag set lives here so bootstrap and vuetify do not each carry a copy, which means this has to reach pub.flutter-io.cn beforeflutter_html_bootstrap0.1.2 andflutter_html_vuetify0.1.1. example/example.mdwas wrong aboutsupportedTags. It said passing it "registers non-standard tag names so flutter_html does not discard them". It does not:flutter_htmlreadssupportedTagsonly in the defaultHtmlExtension.matches, which this class overrides. Measured: a subclass listingv-cardstill renders nothing. The section now shows theTagExtensionthat works.- Docs pass across the README, the example and the dartdoc, to the family style.
The 70-tag list, the four measured cases and the re-derivation recipe moved to
doc/renderable-tags.md, which.pubignorekeeps out of the archive.
0.1.0 #
- Initial release.
ClassListCssResolver: interface for mapping an ordered list of CSS classes to inline CSS declarations.ClassToInlineCssExtension: anHtmlExtensionbase class that runs duringflutter_html'spreStylingstep, merges resolver output into the element'sstyle=""attribute, and is a no-op for elements with no matching classes.