flutter_html_css_all 0.2.0 copy "flutter_html_css_all: ^0.2.0" to clipboard
flutter_html_css_all: ^0.2.0 copied to clipboard

Re-exports twenty-one flutter_html companion packages, nineteen of them CSS extensions, and returns a nineteen-entry extension list in the one order all their rules allow.

0.2.0 #

  • Renamed from flutter_html_css_bundle_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.
  • utilityClassExtensions, a List<HtmlExtension> with a const empty default, replaces utilityClassExtension in BundledCssExtensions and in bundledCssExtensions(). It registers in the slot the single one had, in the order you give, so both utility-class packages can be registered together. utilityClassExtension still works, is @Deprecated('Use utilityClassExtensions'), and is registered first when given. Three class names are defined by both frameworks, rounded, border and text-truncate, and they resolve to different CSS: Bootstrap's rounded is a border-radius of 0.375rem, Vuetify's is 4px. Each extension appends its declarations to the element's inline style, so for a shared class name the later registration wins, because its declaration is appended last.
  • Every sibling constraint is now a range, >=<current floor> <0.4.0, where it was a caret. The floor is each sibling's renamed release. The ceiling is the next major of the family's current highest minor, 0.3.x, so <0.4.0. The rule is written down in doc/order.md.
  • What that buys: a sibling's in-range release now reaches a bundle user on its own, without waiting for a bundle release. So the bundle releases only when an ordering rule changes, when the export set changes, or when a constraint floor moves. It no longer follows every sibling release.
  • .gitlab/renovate.json5 drops the rangeStrategy: 'bump' rule on the siblings and uses widen instead. bump existed to raise an MR for an in-caret release, which is the thing that no longer needs one. widen still raises an MR when a sibling escapes the range, which is when the ceiling has to be looked at by a human.

0.1.5 #

  • flutter_html_css_text_metrics and flutter_html_css_units both move to ^0.2.0. The caret on 0.1.x no longer admits either release, so a bundle user would never have seen them.
  • text-metrics 0.2.0 renders a text-decoration-thickness that states a length or a percentage. 0.1.0 dropped both without a word, because Flutter's decorationThickness is a multiplier of the line the font itself draws and not a length. It is an approximation now: the length divided by one twelfth of the element's own font-size. Measured on a red underline at font-size: 40px, the painted line was 1.00 px for 10px, for 0.25em and for 50% in 0.1.0, because all three were ignored, and it is 2.50 px, 2.50 px and 4.75 px now. auto, from-font and the unitless multiple are what they were, and that package on its own still leaves pt, pc, in, cm, mm, Q, vw, ex, ch and a negative length alone.
  • Which is where the other release comes in. units 0.2.0 rewrites five more properties, text-decoration-thickness, transform, transform-origin, flex and grid-template-columns, and CssUnitsHtmlExtension is position 0 of this list and writes at the preStyling step, so a bundle user's text-decoration-thickness: 30pt reaches the text metrics as 40px. Measured on the same red underline: 79 red pixels, one row tall, before, and 720 pixels, nine rows tall, now, which is what 40px paints on its own. text-metrics 0.2.0's own doc/limitations.md still calls that gap open; it shipped before the release that closes it, and registering this bundle closes it.
  • The same rewrite reaches the two siblings that read a transform length and a flex length, and neither needed a change to get it. transform: translate(1in, 0) displaced the element by 0 and displaces it by 96 logical pixels now. flex: 0 0 2in in a display: flex container gives an item 14.25 wide before and 192 now. grid-template-columns: 2in 1fr goes from 584 and 584 to 192 and 392.
  • One limitation arrives with the thickness, documented upstream, which the extension does not cause and cannot fix: a child that declares its own text-decoration erases the ancestor's line over the child's own text, and paints its own line in the ancestor's colour. One TextStyle cannot carry both. Measured at font-size: 40px with a parent underline red and a child overline blue: 320 red pixels, against 560 with no declaration on the child.
  • Nothing about the registration changed. CssTextMetricsHtmlExtension and CssUnitsHtmlExtension keep their class names, which is what the Bootstrap and Vuetify registries match on, and each matches at the same step as before. units 0.2.0 states no new ordering rule: it writes at preStyling and every sibling that reads what it wrote acts later, so both orders render alike. kCssLengthProperties only gained entries, and kCssAbsoluteUnitsInPx, kCssViewportUnits, CssSpacing and CssSpacingUnit are untouched. The nineteen registered instances, their order and kBundledCssExtensionNames are exactly those of 0.1.4, and doc/order.md still carries the same fourteen rules.
  • doc/order.md carries the qualifier the two releases ask for, at positions 0 and 8: the units rewrite reaches five more properties at the same step, and the text metrics now read a thickness length that arrives already converted.

0.1.4 #

  • flutter_html_css_flex moves to ^0.2.0. The caret on 0.1.x no longer admits that release, so a bundle user would never have seen it.
  • 0.2.0 repairs the rest of the display keywords flutter_html 3.0.0 reads as Display.inline, which demoted a block element to inline text and is worse than dropping the declaration. table now renders as a table display, table-row, the row, header and footer groups and table-caption as block, table-cell and inline-table as a shrink-to-fit box in the line, so two cells sit side by side. table-column and table-column-group render nothing, as a column box does in CSS. flow and run-in render block, and flow-root, contents and the five ruby keywords keep their own Display. The two-value syntax is read as well, so inline flow-root gets the inline-block box it asks for. Measured upstream on a <div> in an 800 px Html: 34 px and an 800x17 box, where each of those keywords used to give 17 px and no box of its own.
  • What it does not bring: no table layout, so no column widths, no shared row height and no borders between cells; a two-value inner flex or grid keyword sets the box level only, so use the one-word form for the layout; an unknown keyword is left alone. One cost comes with it, documented upstream: table maps to the table display rather than to block, and flutter_html trims white space next to a block child only, so a space on either side of the box survives.
  • Nothing about the registration changed. CssFlexHtmlExtension keeps its class name, which is what the Bootstrap and Vuetify registries match on; its building step still claims only a flex or grid container, so it is terminal for the same elements as before; and kCssFlexDisplayValues and kCssFlexProperties are unchanged. The nineteen registered instances, their order and kBundledCssExtensionNames are exactly those of 0.1.3.
  • doc/order.md carries the one qualifier the release asks for: the Bootstrap and Vuetify d-*-table* classes stay suppressed, which is still correct because a suppressed declaration leaves a <div> block anyway, but a display: table written into an inline style no longer demotes its element.

0.1.3 #

  • Documentation only. No code change, no order change, no new dependency: the nineteen registered instances and their sequence are exactly those of 0.1.2.
  • The README's limitation on utility-class suppression was stale. Both packages used to recognise seven of the nineteen; flutter_html_bootstrap 0.1.3 recognises nine, with CssObjectFitHtmlExtension and CssTransformHtmlExtension added, and flutter_html_vuetify 0.1.2 recognises eight, with CssTextMetricsHtmlExtension added. The two counts are stated separately now because they are no longer the same number.
  • What that leaves suppressed is shorter than it was: the border longhands and overflow, in both packages. Bootstrap's 30 object-fit-* classes and its three translate-middle* classes render once their companions are registered, and Vuetify's letter-spacing renders on twelve of its thirteen text-* typography classes — text-h5 states none. None of them is named through FlutterError any more.
  • This package is released for a documentation change, unlike its siblings, because its documentation is what describes the family.

0.1.2 #

  • Three new siblings, so the bundle re-exports twenty-one packages and registers nineteen instances.
  • flutter_html_css_units 0.1.0 is the new first entry, ahead of CssBorderHtmlExtension. It rewrites pt, pc, in, cm, mm, Q, vw, vh, vmin and vmax into px, which is the one length unit flutter_html 3.0.0 reads without loss: 12pt used to render 12 logical pixels and 50vw used to render 0. It has to come first, because a declaration written into the inline style after it has run keeps its unit and is then discarded, and because the border extension reads a length as its bare number. The stylesheet and utility-class arguments still go ahead of it, which is what its README asks for.
  • flutter_html_css_background 0.1.0 goes between the border extension and CssColorHtmlExtension. It rewrites the background shorthand, which flutter_html drops whole, into background-color. Listed after the colour rewrite it would hand flutter_html a raw hsl(0 100% 50%) token, which renders black; in this order it renders red.
  • flutter_html_css_text_transform 0.1.0 goes next to CssTextMetricsHtmlExtension, in the preProcessing group. It renders text-transform, which flutter_html parses and then never applies. It states no order rule, so the position is only there to keep the group together.
  • flutter_html_css_percent_size moves to ^0.2.0. That release adds percentage padding and margin to the percentage width and height it already resolved. It states no new order rule: the clamp survives either order against the size constraints, so the pinned position before CssObjectFitHtmlExtension is unchanged.
  • New argument: viewportSize. Pass a Size and vw, vh, vmin and vmax resolve against it instead of against MediaQuery, which is what CssUnitsHtmlExtension reads by default. Use it under a LayoutBuilder, or where there is no MediaQuery at all.
  • doc/order.md carries fourteen ordering rules now rather than twelve, each with the render failure it prevents, and test/order_test.dart pins the three new positions by name.
  • parseInlineCssDeclarations and stripImportant are hidden on the text-transform export. flutter_html_css_font_size exports both names already, and re-exporting two of each would make the name ambiguous for anyone importing this bundle. Import the text-transform package directly to reach its own pair.

0.1.1 #

  • Wrote down how this package is released: a Releasing section in CONTRIBUTING.md, which ships in the archive. The short version: a v* tag is the publish, this package ships for doc-only changes too, and every sibling release is followed by a constraint bump and a patch release here.
  • Renovate now raises a merge request for every sibling release, not only the ones that escape the caret. .gitlab/renovate.json5 sets rangeStrategy: 'bump' on the eighteen re-exported packages, so ^0.1.0 becomes ^0.1.1 instead of staying silent.

0.1.0 #

  • This release depends on the hosted siblings on pub.flutter-io.cn, every one of the eighteen as a caret constraint, and on no path dependency.
  • Initial release. One dependency and one import for the flutter_html extension packages of this family: it re-exports eighteen packages, and BundledCssExtensions registers sixteen instances, in the one registration order all of their rules allow.
  • The bundle is a class, not a function that hands back a list. BundledCssExtensions is a List<HtmlExtension> through ListMixin, so it drops straight into Html(extensions:), and every constructor on it is const. That was the whole point: const code is better optimised, a const constructor is still callable without const, and a composed bundle stays a compile-time constant. kBundledCssExtensions is a const instance of the defaults and bundledCssExtensions() is the function form, for the call with a dozen arguments. If you saw the earlier working tree, the names used to be cssBundleExtensions(), kCssBundleExtensions and kCssBundleExtensionNames; nothing was published under those, so they are simply gone rather than deprecated.
  • Your own extensions go in through before, after and inserts, all const. An Insert names its anchor with a Type, because a constructor cannot take a type parameter and the family already identifies an extension by its class. Insert.at takes a top-level function from the current list to an index, which is a constant expression, so even that stays const. BundledCssExtensions.insertedBefore, .insertedAfter and .insertedAt are the one-point sugar. An anchor that is not in the list throws an ArgumentError when the list is read, so a typo cannot quietly land your extension at the end, where ten of the sixteen lose the step they need. The list itself is read-only; []=, the length setter and add all throw.
  • There is no prependedBy or followedBy sugar, because plain Dart already covers the non-const case: [...const BundledCssExtensions(), MyExtension()]. That spread cannot be const, which we checked rather than assumed. On Dart 3.13.0 const [...kBundledCssExtensions, X()] is the compile error const_spread_expected_list_or_set: a const spread needs a constant list value, and a const object that implements List through ListMixin is not one. before and after exist for exactly that case.
  • The sixteen instances are created on the first read of the list, not at construction, which is what lets the constructors be const. They are then held in an Expando keyed on the instance, which is the only cache a const class can have. That is not a precaution: HtmlParser reads the list once per element at each of its four extension steps, and ListMixin reads length and operator [] once per entry of each pass. Measured by test/composition_test.dart, group "the build cost": one Html build of the short document there reads the list 1,830 times.
  • It re-exports the sibling classes rather than wrapping them. That is not a style choice: the Bootstrap and Vuetify packages recognise a companion by runtimeType.toString(), so a wrapper would carry the wrong name and quietly switch their suppression back on.
  • Arguments for the settings that change what gets rendered: resolvePercentages for both extensions that resolve one, rootFontSize for all three that resolve a rem, extraCursors for interaction, imgAlt for the alt-text extension, and the full set of eleven image arguments, which go to object-fit. Eight of the eleven reach ImgAltHtmlExtension as well, because the images it renders as text are exactly the ones the renderer declines; only imageNetworkHeaders, imageAssetBundle and imageAssetPackage stop at object-fit. Anything beyond that means building the list by hand, and doc/order.md says what such a list has to respect.
  • flutter_html_css_stylesheet is in, as an opt-in stylesheetExtension: argument that goes ahead of everything else. It is not on by default because registering it changes what flutter_html itself renders: it resolves the cascade for <style> blocks and empties each block it reads.
  • flutter_html_css_percent_size is in, after the size constraint and before object-fit. Neither percentage order is CSS. Measured by the group "the two building step rules, in both orders" in test/render_test.dart, in a containing block of 784, and recorded in doc/order.md: width: 50%; max-width: 100px renders 50 in this order and 384 in the other, and CSS says 100. This order keeps the clamp and errs small.
  • flutter_html_img_alt is in, last, and on by default. It is not a css_* package, but it is the family's comfort default: it renders the alt text of an <img> that flutter_html declines and would otherwise render as nothing at all, and it declines every image the built-in renderer renders, so no picture becomes text. One trap comes with it. It is the last entry, so an ImageExtension registered after the bundle sits behind it, and an ImageExtension with a custom assetSchema loses its image to the alt text. Put that one in before, or pass imgAlt: false. The README and example/example.md both show it.
  • flutter_html_css_font_size sits first among the pre-processing extensions, because it writes the element's font size into its Style and flutter_html_css_text_metrics resolves an em letter-spacing against that same field at the same step. Neither README says so; that one came out of the code. rootFontSize goes to every extension that resolves a rem, so a rem length, a rem line height and a rem font size share a basis.
  • flutter_html_css_color is in, right after the border extension and ahead of border-radius. Its README states the second half of that: border-radius reads border with a colour parser that knows six names and no hsl(), so the rewrite to rgba() has to land first. The first half is ours, and we found it by measuring rather than by reading. The colour extension used to skip border-color, because flutter_html has no case for it, and the border extension is what folds that longhand into a border: shorthand the rewrite can see. Listed the other way round, border-color: hsl(0 100% 50%) rendered black. That finding went upstream: colour 0.1.0 rewrites the longhand too, so the order is no longer required. We keep it anyway, and test/render_test.dart renders the markup in both orders and expects red from each.
  • flutter_html_css_line_height is in, last of the preProcessing step extensions. It is the first sibling with no order rule at all: its README measured it against the font size, the text metrics, a TagExtension, Bootstrap and Vuetify, and nothing moved. It takes rootFontSize as well, so that argument now reaches three extensions instead of two.
  • flutter_html_css_interaction 0.1.1 goes before flutter_html_css_size_constraints, which was that release's own measured rule against size-constraints 0.1.0: in the other order the size constraint ran twice and wrapped twice, 3 ConstrainedBox widgets against 2. Size-constraints 0.1.1, which this bundle depends on, guards its own node as well, so either order now builds 2 and the position is kept by history. The two 0.1.1 releases also fix the StackOverflowError that max-width: 100px; cursor: pointer on one element used to throw, and the render test that pinned that crash now asserts the element renders.
  • The root font size reaches you as kFlutterHtmlRootFontSize, from flutter_html_css_font_size. Four packages used to export the same value as kFlutterHtmlDefaultFontSize, which made two of them a compile error to import together; three have dropped the name and flutter_html_css_size_constraints deprecates it in its 0.1.1, which is the release this bundle depends on. It is hidden here as well, so one import of this bundle hands you one root font size constant and not two. Import the size-constraints package directly if you still need the old name.