149 features tagged with this topic.
Enabled by default (77)
A ::column pseudo element, which allows applying a limited set of styles to the generated fragments. Specifically, this would be limited to styles which do not affect the layout, and thus can be applied post-layout.
Tweak web font loading, so that:
- Web fonts with 'font-display: optional' never cause relayout
- Web font preloading is allowed to slightly block rendering (for all font-display values), so that if the font loads fast enough, we don't need to render with fallback.
Therefore, when 'font-display: optional' and preloading are used together, we'll never see layout shifting from font swapping, and still have a good chance to use the font if it loads fast enough (e.g., from disk cache).
Also tagged: Fonts & Text Performance & Scheduling
Introduces new @font-face descriptors ascent-override, descent-override and line-gap-override to override metrics of the font. This allows web authors to (i) achieve interoperable text layout across browsers and platforms, and (ii) reduce layout shifting caused by web fonts.
Also tagged: Fonts & Text
Adds two CSS features. The 'clip' value results in a box’s content being clipped to the box's overflow clip edge. In addition, no scrolling interface is provided, and the content can not be scrolled by the user or programmatically.
The overflow-clip-margin property enables specifying how far outside the bounds an element is allowed to paint before being clipped.
`align-content` CSS property works for block containers and table cells.
The property worked only for flex containers and grid containers. It supports block containers and table cells, that is to say `display: block`, `display: list-item`, `display: table-cell`, etc.
The Android On-Screen Keyboard resizes the visual viewport by default rather than the initial containing block. Authors can opt out of this using the new "interactive-widget" meta-viewport key.
Auto Sizes allows developers to set the sizes attribute to auto (sizes=auto) for lazy loaded image elements with srcset. For this use case the image's width and height should be provided. The browser will use the layout width of the image in order to select the source url from the srcset.
Also tagged: Performance & Scheduling
The "baseline-source" properties allows web developers to specify if an inline-level box should use the "first" or "last" baseline for alignment within an linebox.
Today the default behaviour is confusing for web developers. Consider:
test <div style="display: inline-block;">line1<br>line2</div>
test <div style="display: inline-flex;">line1<br>line2</div>
The "inline-block" will align to the last baseline, and the "inline-flex" will align to the first baseline.
"baseline-source: auto" is the existing (confusing) behaviour.
Web developers can specify "baseline-source: first" or "baseline-source: last" to directly determine how they want these boxes to align within a line-box.
Support style() container queries without a declaration value, only a property name, as a way of matching non-initial values.
Previously you would have to do:
not style(--my-property: initial)
Now you can do:
style(--my-property)
to match any non-initial value.
Applies the kerning to CJK punctuation characters to produce the visually pleasing typography as defined by JLREQ (Requirements for Japanese Text Layout) and CLREQ (Requirements for Chinese Text Layout).
Many CJK punctuation characters include glyph-internal spacing. For example, the CJK full stop and the CJK close parenthesis usually have glyph-internal spacings on the right half of their glyph spaces, to give them a constant advance as other ideographic characters. But when they appear in a row, the glyph-internal spacings become excessive. This feature adjusts such excessive spacing.
This feature adjusts the glyph-internal spacing for three cases: 1) adjacent characters (pair kerning), 2) at the line start, and 3) at the line end. To avoid the risk of excessive kerning, fonts must have the OpenType `halt` or `chws` feature, or both. If the font doesn’t have either feature, the effect is disabled.
This feature implements 4 values: `normal`, `trim-start`, `space-all`, and `space-first`.
Also tagged: Fonts & Text
Computes the aspect ratio of an image using the HTML width and height attributes so that it can be used for sizing an image using CSS before it loads.
Also tagged: Media & Real-time Communication
Container Queries allow authors to style elements according to the size of a container element.
It's similar to a @media query, except it evaluates against the size of a container instead of the size of the viewport.
Also tagged: Media & Real-time Communication
The ::marker pseudo-element represents the automatically generated marker box of a list item.
Like ::before and ::after, ::marker is a tree-abiding pseudo-element, so it always fit within the box tree.
But unlike ::before and ::after, currently it only accepts a small subset of safe properties, because the marker box layout is mostly undefined.
Note this intent only covers ::marker, not ::before::marker nor ::after::marker (see crbug.com/1097992).
The 'lh' unit adds support for expressing CSS lengths relative to the line-height.
That is typically useful for specifying the height of an element to fit a whole number of lines. Example: textarea { height: 5lh }
@container selectors that contain unsupported queries will never select any containers, meaning they will never match.
That means this query will never match any container even if there is a size container that will match the width query that would otherwise make the selector match in cases like this:
@container (width > 0px) or (unknown) {}
This is a recent change to the specification to avoid forward-compatibility issues.
Specifies the minimum number of characters in a hyphenated word. When applying the hyphenation, the optimal minimum number of characters in the word, before the hyphen, or after the hyphen can vary by the design of the page, or by the language. This property allows the finer grained control of the hyphenation.
Also tagged: Fonts & Text JavaScript Language Privacy & Identity
Normally, only certain replaced elements have an aspect ratio, particularly images. For them, if only one of width and height is specified, the other can be computed from it using the intrinsic aspect ratio.
This property allows explicitly specifying an aspect ratio for any other element to get similar behavior.
Blink supports `manual` and `none` values of the CSS `hyphens` property since M55, but `auto`, which enables the automatic hyphenation, is supported only on Android and Mac.
This feature enables `hyphens: auto` on Windows, Linux, and ChromeOS by downloading dictionary files used in Android Open Source Project.
The previous feature entry for M55 is https://www.chromestatus.com/features/5642121184804864
Also tagged: Fonts & Text
'cap' is equal to the used cap-height of the first available font.
'rcap' is equal to the value of the cap unit on the root element.
Also tagged: Fonts & Text
The contain-intrinsic-size property allows developers to specify a placeholder size which would be used while contain: size is applied. With contain-intrinsic-size specified, elements lay out as if they had a single child with fixed size (specified by contain-intrinsic-size) unless they have an explicit width/height.
This is helpful when size containment may be dynamically added/removed so that there is a fallback size during size containment but a content-based size during regular sizing.
Look up query containers in the flat tree ancestor order instead of shadow-including order.
The specification for container queries changed to look up flat tree ancestors. This change is only relevant for shadow DOM where an element will now be able to see non-named containers inside shadow trees into which the element or one of its ancestors are slotted, even if the CSS rule does not use ::part() or ::slotted().
A primitive for isolating style, layout, and paint. This allows authors to explicitly opt into a set of restrictions that enables user agent optimizations.
A CSS box model optimized for user interface design. In the flex layout model, the children of a flex container can be laid out in any direction, and can "flex" their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent.
Make flexbox and flex items obey the positional alignment keywords from https://drafts.csswg.org/css-align-3/#positional-values.
Flexbox previously only obeyed center, flex-start, and flex-end. The additional alignment keywords (start, end, self-start, self-end, left, right) allow authors to more easily align the flex items in the face of varying writing modes and flex flows.
A two-dimensional grid-based layout system, optimized for user interface design.
In CSS Grid, the grid-template-columns and grid-template-rows properties allow developers to define line names and track sizing of grid columns and rows, respectively. Supporting interpolation for these properties will allow grid layouts to smoothly transition between states, instead of snapping at the halfway point of an animation or transition.
Web developers can use this functionality to achieve specific interactive effects.
Adjusts the lengths of lines in a paragraph balanced, for better readability and to minimize typographic orphans.
This is often useful for headlines. For example:
h1, h2, h3, h4, h5, h6, blockquote { text-wrap: balance; }
More examplles can be found in a Chrome Developers blog <https://developer.chrome.com/blog/css-text-wrap-balance/>.
In addition to the "text-wrap" property, the "white-space-collapse" property is also supported, and the "white-space" property becomes a shorthand of these two properties.
Also tagged: Fonts & Text
With CSS Highlight Inheritance, the CSS Highlight pseudo classes, such as ::selection and ::highlight, inherit their properties through the pseudo highlight chain, rather than the element chain. The result is a more intuitive model for inheritance of properties in highlights. Specifically, "When any supported property is not given a value by the cascade ... its specified value is determined by inheritance from the corresponding highlight pseudo-element of its originating element’s parent element." There are some caveats due to properties not allowed on a highlight pseudo and historical usage: units depending on fonts, container queries, viewports etc. use metrics from the originating element, and all custom property values used in the highlight pseudo are taken from the originating element (inherited through the originating element cascade). (https://drafts.csswg.org/css-pseudo-4/#highlight-cascade)
Also tagged: Fonts & Text
Enables a typographic decoration called "initial letter" or "drop caps." Initial letters are large, decorative letters that have been used to start new sections of text since before the invention of printing. In fact, their use predates lowercase letters entirely.
Also tagged: Fonts & Text
The CSS interpolate-size property allows a page to opt in to animations and transitions of CSS intrinsic sizing keywords such as auto, min-content, fit-content, etc., in the cases where we can animate those keywords.
The CSS calc-size() function is a CSS function similar to calc(), but that also supports operations on exactly one supported sizing keyword. Currently supported sizing keywords are auto, min-content, max-content, fit-content, and (for flex-basis) content. Other sizing keywords that may be supported in the future include stretch (currently supported as prefixed -webkit-fill-available) and contain. This function is used to represent the values in the middle of the animations allowed by the interpolate-size property.
Extends the CSS sizing properties with keywords that represent content-based "intrinsic" sizes and context-based "extrinsic" sizes, allowing CSS to more easily describe boxes that fit their content or fit into a particular layout context.
(Note that the "fill" keyword is only shipping prefixed so far, pending CSSWG agreement to unprefix)
Implement {inline-,block-}size and {min-,max-}{inline-,block-}size, which are introduced by CSS Logical Properties.
The related properties are: inline-size, block-size , min-inline-size,min-block-size, max-inline-size, max-block-size
Provide the author with the ability to control layout through logical, rather than physical, direction and dimension mappings.
The "scrollbar-gutter" property provides control over the presence of scrollbar gutters (the space which may be reserved to display a scrollbar), allowing authors to prevent layout changes as content expands while avoiding unwanted visuals when scrolling isn't needed.
Note that the presence of the scrollbars themselves is determined by the "overflow" property and the decision of whether to use classical or overlay scrollbars is up to the User Agent.
The CSS Properties and Values API spec defines a registerProperty() function which can be called from JavaScript to register typed and animatable custom CSS properties. This API expands the existing CSS custom properties to improve usability of other Houdini APIs. Being able to animate these and customize inheritance and initial values makes it more useful for custom layout/paint, and having types associated with these allows the typed object mode to work more effectively with custom properties.
Also tagged: JavaScript Language
Support of new CSS property `ruby-align` is added.
The property accepts one of `space-around` `space-between` `start` and `center` keywords, and controls alignment of ruby base text and ruby annotation text.
Use container queries to style descendants of containers based on their scroll state.
The query container is either a scroll container, or an element affected by the scroll position of a scroll container. The following states can be queried:
- Whether a sticky positioned container is stuck to one of the edges of the scroll box (stuck)
- Whether a scroll snap aligned container is currently snapped horizontally or vertically (snapped)
- Whether a scroll container can be scrolled in a queried direction (scrollable)
A new container-type:scroll-state is introduced to allow such containers to be queried.
For instance:
#sticky {
position: sticky;
container-type: scroll-state;
}
@container scroll-state(stuck: top) {
#sticky-child { font-size: 75% }
}
Also tagged: Fonts & Text
The CSS Scrollbars spec allows authors to style scrollbars by specifying their colors and thickness. This spec adds the following two properties.
The scrollbar-color property provides the capability of changing the color scheme of scrollbars so they fit better into the particular style of a web page.
The scrollbar-width property allows the use of narrower scrollbars that may be more suitable for some use cases, or even to hide the scrollbars completely without affecting scrollability.
Also tagged: Progressive Web Apps
Implements the CSS Grid Layout Module Level 2 specification, which introduces the concept of a "subgrid" to nested grid containers.
To achieve optical balance of text content, the text-box-trim and text-box-edge properties, along with the text-box shorthand property, make finer control of vertical alignment of text possible.
The text-box-trim property specifies the sides to trim, above or below, and the text-box-edge property specifies how the edge should be trimmed.
These properties allow developers to control vertical spacing precisely by using the font metrics.
Note that the `ideographic` and `ideographic-ink`, two values for the text-box-edge property for CJK, are deferred to future releases due to open issues currently under discussion.
Also tagged: Fonts & Text
Adjusts line breaking to avoid a short single word on the last line (also known as typographic orphans.)
When `text-wrap: pretty` is specified, paragraphs that will end up with a short single word on the last line are adjusted so that the last line has two or more words. It also adjusts hyphenation if consecutive hyphenated lines appear at the end of a paragraph.
The algorithm is based on the Knuth-Plass algorithm, as used by TeX. It computes scores for all candidates, and chooses the best one. To balance between the typographic benefits and the performance impacts, it adjsuts the last 4 lines of paragraphs that meet certain conditions.
Also tagged: Fonts & Text Performance & Scheduling
The new CSSOM provides typed style access for developers. This will generally improve performance primarily by removing the need to do lots of string parsing. In addition to this, it will enable performant development of various new Houdini specifications (including custom properties, layout and paint).
Only a subset of CSS properties are supported for now:
https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/Source/core/css/cssom/README.md
Also tagged: Performance & Scheduling
The API exposes getBoxQuads(), convertQuadFromNode(), convertRectFromNode(), and convertPointFromNode() on Document, Element, Text, and CSSPseudoElement so authors can obtain and convert precise DOM geometry using standard DOMPoint, DOMRect, and DOMQuad objects.
Also tagged: JavaScript Language
This API helps developers to detect the current posture of a foldable device. The device posture is the physical position in which a device holds which may be derived from sensors in addition to the angle.
From enhancing the usability of a website by avoiding the area of a fold, to enabling innovative use cases for the web, knowing the posture of a device can help developers tailor their content to different devices.
Content can be consumed and browsed even when the device is not flat, in which case the developer might want to provide a different layout for it depending on the posture state in which the device is being used.
Also tagged: Device & Hardware
display: flow-root generates a block container box, and lays out its contents using flow layout. It always establishes a new block formatting context for its contents.
The FIELDSET element will support 'inline-grid', 'grid', 'inline-flex' and 'flex' keywords for CSS 'display' property.
The original HTML/CSS specifications were unclear about the intended behavior for elements inside display:none iframes. [Do they get CSS boxes? Are they rendered?] This has led to a divergence in behavior between UAs. The specs are in the process of being clarified, and the new spec matches the behavior of Edge and Gecko [which do not perform box construction or layout]. Note that Chrome's current behavior has negative performance implications.
https://github.com/whatwg/html/issues/1813
Also tagged: Performance & Scheduling
By 'field-sizing' property, web authors can disable fixed default sizes of form controls, and make their size depend on their content. It's very easy to provide automatically-growing text fields.
We changed our rendering to match the flexbox specification and other browsers. In previous versions, Chrome did not implement the automatic minimum size for the specific case of a column flexbox containing a flex item that is itself a flexbox. We have now changed this so that such flex items do get the right minimum size.
This can cause flex items to not shrink anymore when they used to; to avoid that, set min-height: auto on the flex item.
Support box-decoration-break:clone both for inline fragmentation (line layout) and block fragmentation (pagination for printing, multicol).
Traditionally in Blink, only box-decoration-break:slice (the initial value) has been supported for block fragmentation, whereas for inline fragmentation, box-decoration-break:clone was also supported, but only when using the prefixed -webkit-box-decoration-break property.
See https://drafts.csswg.org/css-break/#break-decoration
This css property allows you to specify spacing between flex items and/or flex lines.
visibility:collapse is supposed to hide table rows while preserving their contribution to column widths. Right now blink treats visibility:collapse as visibility:hidden, which merely skips painting the rows, leaving blank space in their place instead of allowing their space to be used for other content.
Intl.Segmenter implements methods for finding the location of boundaries in text, including grapheme,word and sentence boundary analysis.
Also tagged: JavaScript Language
This feature allows developers to align items within either flex or grid layout by their last baseline, instead of their first.
This is done via the following properties:
align-items: last baseline; /* flex/grid container */
justify-items: last baseline; /* grid container */
align-self: last baseline; /* flex/grid item */
justify-self: last baseline; /* grid item */
The 'line-break: anywhere' declaration allows soft wrapping around every typographic character unit, including around any punctuation character or preserved spaces, or in the middles of words. It disregards any prohibition against line breaks, even those introduced by characters with the GL, WJ, or ZWJ character class (see UAX 14) or mandated by the word-break property.
Also tagged: Fonts & Text
Line-breaks are possible within elements with `display: ruby`.
A single pair of a ruby-base and a ruby-text has never been line-breakable, and it has been pushed to the next line if the current line had no enough space for the entire pair. Now each of the ruby-base and the ruby-text can be split into multiple lines.
This converts contain-intrinsic-size to a shorthand and adds corresponding contain-intrinsic-{width,height} properties as well as contain-intrinsic-{inline,block} size.
For example, this will make the following work:
<div style="writing-mode: vertical-lr; contain: size; contain-intrinsic-inline-size: 100px; contain-intrinsic-block-size: 50px;"></div>
Elements with table-row, table-row-group, table-header-group, table-footer-group, table-cell, and table-caption that have a transform property should be containing blocks for fixed position elements. Blink currently does not make <tr>, <tbody>, <tfoot>, and <thead> be a containing block for fixed position elements, which we propose to change.
Supports MathML Core, a language for describing mathematical notation embeddable in HTML and SVG. MathML is rendered in a CSS-compatible way with OpenType MATH and exposed via platform accessibility APIs. MathML styling is enabled by CSS features including those dedicated to math layout (math-depth, math-shift and math-style properties, 'math' display value, 'math' font-family name and 'math-auto' text-transform). Finally, the MathMLElement interface provides a convenient way to manipulate MathML in scripts.
Also tagged: Fonts & Text Performance & Scheduling
Support the 'page' CSS property [1], along with named pages support (@page foobar {} selector). Also support the 'page-orientation' descriptor [2] for @page, with values 'upright' (initial value), 'rotate-left', or 'rotate-right'.
[1] https://www.w3.org/TR/css-page-3/#using-named-pages
[2] https://drafts.csswg.org/css-page-3/#page-orientation-prop
Also tagged: Media & Real-time Communication
OpenType variable fonts integration in the layout engine affects at least the following aspects:
1) Axis value assignments from font-variation-settings
2) Integration of variable fonts axis parameters into layout operations
3) Font matching for:
* Matching based on canonical scalable axes such as width or weight or optical sizing.
* Matching named instances
4) Feature resolution of CSS props, feature-settings and variation settings
Also tagged: Fonts & Text
The new value 'anywhere' allows an otherwise unbreakable sequence of characters to be broken at an arbitrary point if there are no otherwise-acceptable break points in a line.
Additionally, soft wrap opportunities introduced by 'anywhere' are considered when calculating min-content intrinsic sizes.
When Worklet.addModule() fails, a promise rejects with a more specific error object than it did previously.
Worklet.addModule() can fail for various reasons, including, for example, network errors and syntax errors. Before this change, Worklet.addModule() rejected with AbortError regardless of the actual cause. That made it difficult for developers to debug worklets. After this change, Worklet.addModule() rejects with a clearer error such as SyntaxError.
Also tagged: Performance & Scheduling
Feature is not part of formal spec and will be subsumed by upcoming css-line-grid spec in discussion. Only supported by Safari among major browsers. Utilization is low.
The CSSWG resolved to rename this property, because "fallbacks" more accurately describes what this property controls. The word "options" is a bit deceiving, since the styles outside of `position-try` blocks will be tested first, and if they result in a layout that fits within the containing block, none of the "options" will get used. So "fallbacks" is a better word to describe this behavior.
https://github.com/w3c/csswg-drafts/issues/10395#issuecomment-2192127524
One note for developers: there is a `position-try` shorthand (see https://drafts.csswg.org/css-anchor-position-1/#position-try-prop) that can be used to help this migration. If you set `position-try` instead of `position-try-options` *or* `position-try-fallbacks`, the shorthand will set the proper longhand before and after this rename.
Also tagged: CSS Anchor Positioning
New CSS display property values, "ruby" and "ruby-text", are added.
The default display values of <ruby> and <rt> are changed to "ruby" and "ruby-text" respectively, and ruby layout respects these display values. Web authors can use any elements such as <div> to render ruby by setting the new display values.
In https://chromestatus.com/feature/5174306712322048 we've added dynamic safe area insets which can change as the user interacts with the device. This proposal amends the general safe area feature to add max-area-safe-inset-* variants of the variables which do not change and represent the maximum possible safe area inset.
The use case this solves is to avoid needing to relayout the page in cases where the footer (for example) can simply slide as the safe area inset value grows, as opposed to changing size.
Support of `sideways-rl` and `sideways-lr` keywords for `writing-mode` CSS property is added.
They are vertical writing modes, and all letters are sideways.
The size-adjust descriptor in @font-face allows scaling of glyph sizes for a particular font face without affecting the CSS font-size and derived metrics such as em.
CSS font-size can be seen as a scale factor for a box that the font draws in. Glyph sizes within that box vary between fonts, and size-adjust enables harmonising them across different fonts. That's why it can also help with reducing cumulative layout shift by matching up the fallback font and primary web font using this descriptor.
Also tagged: Fonts & Text
The <slot> element can now participate in a flat (layout) tree, with UA style: display: contents. Before this change, applying a CSS selector to a <slot> element had no effect. Not only is this fixed, when selectors are applied to a <slot> element, it's children inherit its styles.
Adds a style() function to @container rules to make it possible to apply styles based on the computed values of custom properties of an ancestor element.
style() queries can be combined with size container queries which shipped in M105.
The CSS 'line-break' property specifies the strictness of line-breaking rules. The exact definition of the strictness depends on languages.
Our implementation relies on ICU (see doc link) which supports East Asian writing systems and Finnish.
Rename gutter properties to remove "grid-" prefix:
* grid-gap => gap
* grid-row-gap => row-gap
* grid-column-gap => column-gap
Note that column-gap already exists and is used by css-multicol.
The parsing needs to be updated as now the default value is "normal".
The old (prefixed) properties names will be kept working as aliases.
The print-color-adjust allows adjusting colors in printed web pages.
This is the same as Chromium's already-supported -webkit-print-color-adjust, but with a standardized name.
The -webkit-prefixed version is not removed.
https://developer.mozilla.org/en-US/docs/Web/CSS/print-color-adjust
This updates the behavior of percentage row tracks and gutters in grid containers with indefinite heights. Previously, these were behaving similarly to percentage heights in regular blocks, but the CSS WG has resolved to make them behave the same as for columns, making them symmetric. Percentages are now ignored when computing intrinsic height and resolved afterwards against that height. That way both column and row axes will have symmetric behavior to resolve percentages tracks and gutters.
Makes the browser use the user's preferred color scheme to render the viewport scrollbars if the value of "page’s supported color schemes" is 'normal' or not specified, and the computed value of the color-scheme for the root element is 'normal'. Viewport scrollbars can be considered to be outside the web content. Therefore, the user agents should honor the user's preferred color scheme when rendering viewport scrollbars if page authors have not explicitly specified support for color schemes.
Adds the break-spaces value for the white-space property which specifies that any sequence of preserved white space that would otherwise overflow a line and hang (as per the CSS Text Module spec's Trimming and Positioning rules) must be broken.
Also tagged: Fonts & Text
When the window controls overlay is enabled for installed desktop web apps, the app's client area is extended to cover the entire window--including the title bar area--and the window control buttons (close, maximize/restore, minimize) are overlaid on top of the client area. The web app developer is responsible for drawing and input-handling for the entire window except for the window controls overlay.
Also tagged: Progressive Web Apps
Proposed (38)
Allows authors to style descendants of containers based on the most recent scrolling direction.
Example:
.scrolling-up {
translate: 80px 0;
transition:
0.4s translate;
}
html {
container-type: scroll-state;
}
@container scroll-state(scrolled: top) {
.scrolling-up {
translate: 0 0;
}
}
Also tagged: JavaScript Language Performance & Scheduling
Support of `text-justify` CSS property
Web authors can control how text is justified when `text-align: justify` is applied by using the `text-justify` property. For example, they can force justification by expanding inter-character space even in English text.
The CSS zoom property is animatable and interpolates as a <number>. Developers can transition and animate zoom to smoothly scale elements and their layout, complementing existing transform-based scaling.
We are changing the initial value of the "position-anchor" CSS property from "none" to normal to align with other browsers and the specification.
"normal" behaves like "none" if the "position-area" CSS property is "none", otherwise behaves as "auto".
Also tagged: CSS Anchor Positioning
Support multiple queries per @container rule. The @container rule applies if at least one of the queries matches.
This makes it possible to have fallback queries for features which are not supported in all browsers, for instance.
Example:
@container --name1 not-supported(--foo: bar), --name2 (width > 600px) {}
Along with the support for multiple queries, the object model is extended to support the 'conditions' attribute on the CSSContainerRule API.
This feature is a result of a CSSWG resolution: https://github.com/w3c/csswg-drafts/issues/8407#issuecomment-1440466558
content-visibility: auto is a property that can be used to optimize rendering of off-screen content. However, when rendering is optimized it also means that the size of the element cannot be determined using the descendant information. This is done with size containment.
As a result, contain-intrinsic-size was added to help with this. When content-visibility: auto skips contents, contain-intrinsic-size determines its size (roughly as if it had a single child of specified size).
contain-intrinsic-size also has an option to add an "auto" keyword which means "if the element has been previously rendered, then use that size; if not, use the specified size". This helps with layout stability by ensuring that elements that come into the viewport and then leave remain the same size as before.
This feature tracks forcing contain-intrinsic-size: auto if content-visibility's value is auto.
Scales the font size of text nodes to perfectly fit the width of its containing box.
This property allows developers to ensure headlines or dynamic content fill the available horizontal space without manual font-size calculations or complex JavaScript workarounds. It provides a robust, CSS-native solution for responsive typography that maintains visual alignment across different screen sizes and varying text lengths.
Also tagged: Fonts & Text JavaScript Language
When an anchor-positioned element is tethered against an anchor that has a transform (or is contained by something with a transform), resolve anchor() and anchor-size() functions against the bounding box of the transformed anchor.
Also tagged: CSS Anchor Positioning
Introduce @container anchored(fallback) to style descendants of anchor positioned elements based on which of position-try-fallbacks is applied.
Such queries can be used to e.g. style an anchored element's tether, its animations, etc. based on how the anchor and the anchored element are positioned relative to each other.
Example:
#anchored {
position-try-options: flip-block;
container-type: anchored;
}
@container anchored(fallback: flip-block) {
#anchored > .arrow {
--arrow-rotation: 180deg;
}
}
Also tagged: CSS Anchor Positioning
The CSS block-step-size property rounds a block-level box's outer
block-size up to a multiple of a step unit, so vertical rhythm survives
content changes. A box with a step establishes an independent formatting
context; a block-level replaced child is re-centered via block-axis
margins so its outer size is also a multiple.
CL: https://chromium-review.googlesource.com/c/chromium/src/+/8843502
Also tagged: Fonts & Text
Introduce the flow-start/end keywords as value aliases for the existing flex-start/end keywords as resolved in the CSSWG. These are needed for alignment in the case of placement reversals.
flow-start in CSS Grid-Lanes would indicate the starting edge of the container at which placement begins, which is useful in the case where placement is reversed (`fill-reverse`, `track-reverse`, discussed in this CSSWG issue: [css-grid-3][masonry] item-flow row vs. column in masonry layouts · Issue #12803 · w3c/csswg-drafts). Because these are acting as value aliases, we expect flex-start/end to follow the logical directions in Grid Lanes, as well, which will expand the definition of these keywords from only applying special behavior in flexbox to applying to any layout mode whose logical start/end is different from its physical start/end.
For serialization, if either flex-start/end or flow-start/end is used, the returned serialized value should be flow-start/end.
Also tagged: Device & Hardware
This property allows some predefined punctuation characters to be placed outside the line box, at the start or at the end of a line of text.
The `first` and the `last` values are for the usages in the Latin typography. The `allow-end` is often seen in Japanese novels. The `force-end` will not be included in the initial release as it is less often used and Safari doesn't implement it.
Also tagged: Fonts & Text
Adds the `kashida` value to `text-justify`, allowing authors to justify
Arabic and other cursive-script text by elongating connections within
words. The inherited `text-kashida-space` percentage controls how
justification space is divided between kashida elongation and inter-word
spacing.
CL: https://chromium-review.googlesource.com/c/chromium/src/+/7957320
Launch Chromium with:
--enable-blink-features=CSSTextJustifyKashida,CSSTextKashidaSpace
Then visit:
https://static.januschka.com/i-41431127/
Also tagged: Fonts & Text
Enables percentage values for the letter-spacing and word-spacing CSS property, as defined in the CSS Text Module Level 4 spec. Percentage values are calculated relative to the advance measure of the space character (U+0020). This gives developers more robust and flexible control over typography, particularly in responsive designs where text spacing needs to adapt to different viewports and font sizes.
Also tagged: Fonts & Text JavaScript Language Media & Real-time Communication
A CSS query container can be queried based on its container-name only, and the container does not need any container-type set:
<style>
#container {
container-name: --foo;
}
@container --foo {
input { background-color: green; }
}
<style>
<div id="container">
<div><input></div>
</div>
Previously, @container required some query in addition to the name.
Detects whether a user has requested bold text in their operating system's accessibility settings via the prefers-bold-text CSS media query. The media query evaluates to bold when the user has enabled system-wide bold text (such as Android's Bold text accessibility toggle) and no-preference otherwise. This allows web developers to adapt font weights, variable font grade axes, or typography tokens to improve text legibility for users who prefer bold text without breaking existing page layouts or visual hierarchy.
Also tagged: Fonts & Text Media & Real-time Communication
Support of new CSS property `ruby-overhang` is added.
The property accepts one of `auto`, `spaces` and `none` keywords to control overhang of ruby annotation text. Per CSSWG, none is aliased to spaces, allowing overhang only over whitespace and CJK punctuation. This prevents unnecessary layout gaps while preserving text readability.
Shrinks container width to match the maximum line length of its wrapped content.
While keywords like fit-content leave empty space when text wraps, this CSS property tightly fits the container around the actual rendered layout to eliminate awkward trailing gaps.
The CSS symbols() function lets authors define a counter style inline instead of first declaring a named @counter-style at-rule.
It builds an anonymous counter style from a list of string symbols plus an optional counting system (cyclic, numeric, alphabetic, symbolic, or fixed), and is accepted as the counter style in list-style-type, the list-style shorthand, and counter() / counters().
Add the full-size-kana value to the text-transform property.
This value transforms small Japanese kana characters to their full-size equivalents. It is typically used for ruby annotation text, where small kana may be rendered at font sizes too small for legibility.
Also tagged: Fonts & Text
Add the full-width value to the text-transform property.
This value transforms ASCII characters and specific symbols into their full-width Unicode variants, so they visually align with ideographic characters. It is typically used in Japanese, Chinese, or Korean typesetting where uniform character width is expected.
Also tagged: Fonts & Text JavaScript Language
Introduce matchContainer() on Element instances for the container query, that provides a similar mechanism to window.matchMedia().
Also tagged: Media & Real-time Communication
Printers usually have a small area at each of the four edges of a sheet of paper that they are not capable of marking reliably, usually due to the printer’s paper handling mechanism. The default page margins are expected to be bigger than these areas, but if authors set margins on their own, and even want to add @page margin boxes (e.g. for custom headers and footers), they need a way of telling where it's safe to print and not.
The CSS descriptor `page-margin-safety` can be used to steer clear of such unprintable areas.
flex-wrap:balance allows developers to distribute content between flex-lines so that it appears more balanced (similar to text-wrap:balance).
Implement the CSS Flexbox visibility-collapse algorithm for flex items. Collapsed flex items should have zero main-axis size during line collection while preserving line cross-size contribution as a strut, per spec.
CL: https://chromium-review.googlesource.com/c/chromium/src/+/7675197
sampler: https://static.januschka.com/i-41085247/
This feature allows developers to align the content of the boxes participating in row-like shared context by their last baseline, instead of their first.
This is done via the following property:
align-content last baseline; /* Table cells, Flex items or grid items */
Add `styleDuration` and `forcedStyleDuration` information to the Long Animation Frame API, enabling developers to distinguish style and layout times.
Also tagged: Performance & Scheduling
The `margin-trim` CSS property may be used to omit margins before or after the first or last child of a container. This is supported on regular block containers and multicol containers.
This is somewhat similar to the effect caused by the margin quirk that is applied to P, H1, H2... elements inside BODY and table cell elements (in quirks mode), but more powerful, generic, and expressive.
Note: A previous version of the spec also applied this for flex and grid containers, but this has been removed.
Ignore tree-scope when matching container-name for @container queries.
Previously, container-name matching for container queries used tree-scoped names/references for matching, which meant the same name would not match if the @container rule and the container-type property
were originating from different trees such that that container-type declaration came from an inner shadow tree.
With this change container names match regardless of @container rule or container-type declaration origins.
`OpaqueRange` represents a live span of text within a form control’s value, such as a `<textarea>` or text-based `<input>`, so developers can work with value text using range-like APIs.
It enables operations such as `getBoundingClientRect()`, `getClientRects()`, and integration with the CSS Custom Highlight API for UI such as inline suggestions, highlights, and anchored popovers. It preserves encapsulation by exposing only value offsets and not `startContainer` and `endContainer`, so DOM endpoints and internal structure are private.
This feature enhances CSS style queries and the if() function by adding support for range syntax.
This extends style queries beyond exact value matching (e.g., style(--theme: dark)). Developers can now use comparison operators (>, <, etc.) to compare custom properties, literal values (like 10px or 25%), and values from substitution functions like attr() and env(). For a comparison to be valid, both sides must resolve to the same data type. This is limited to the following numeric types: <length>, <number>, <percentage>, <angle>, <time>, <frequency>, and <resolution>.
This allows for creating more dynamic components that adapt based on a range of inputs, not just predefined states.
Examples:
/* Compare a custom property against a literal length */
@container style(--inner-padding > 1em) {
.card { border: 2px solid; }
}
/* Compare two literal values */
@container style(1em < 20px) {
...
}
/* Using style ranges in if() */
.item-grid {
background-color: if(style(attr(data-columns, type<number>) > 2): lightblue; else: white);
}
The overscroll-behavior applies to all scroll container elements, regardless of whether those elements currently have overflowing content or are user scrollable. Developers can use overscroll-behavior to prevent scroll propagation on an `overflow: hidden` backdrop or an `overflow: auto` element without needing to consider whether it will currently be overflowing.
Allow sites to opt into iframes having responsive sizing (sizing the <iframe> element in the parent document to the iframe document's layout overflow sizing, so that scrolling in the child document is avoided).
Extends the `overflow` property to support scrollable values together with `clip` (for example, `overflow: scroll clip`). This allows `position: sticky` to be constrained by different ancestor scroll containers per axis, and gives authors a way to ensure an axis using `overflow: clip` stays in place.
Adds support for the path() and shape() shape functions in the CSS shape-outside property. These functions allow developers to define the shape of `shape-outside` more flexibly and support animation.
Demo:
- https://codepen.io/una/full/ogzRBWV
- https://codepen.io/yisi/full/EaNjzvR
The two optional keywords for the `text-indent` property extends the capability and the usability of the property.
The `hanging` keyword changes indentation to "hanging", that is, all lines except the first line will be indented.
The `each-line` keyword makes indentation to affect not only the first line but also each line after a forced line break.
Also tagged: Fonts & Text
The revert-rule keyword rolls back the cascade to the previous rule, similar to how revert-layer rolls back the cascade to the previous layer. For example:
```
div { color: green; }
div { color: revert-rule; /* Effectively green */ }
```
This is especially useful in combination with conditionals, as it allows eliminating the current rule if some condition is not met:
```
div {
display: if(style(--layout: fancy): grid; else: revert-rule);
}
```
This feature changes the attribution data (`prevRect` and `currentRect`) in the [LayoutShift API](https://wicg.github.io/layout-instability/) to be reported in CSS pixels instead of physical pixels.
The current behavior is inconsistent with other layout-related APIs, which all use CSS pixels. This change improves consistency, simplifies usage for developers, and aligns with expected units in debugging and tooling.
Also tagged: Performance & Scheduling Privacy & Identity