Post by account_disabled on Sept 16, 2023 8:19:41 GMT
Another big problem was that it was difficult to get a proper grid layout, which was solved with the introduction of the CSS Grid Layout module.
Grid is now fully supported Phone Number List and standardized across all browsers . Grid layout is indicated by the display: grid declaration, and can be said to be a kind of cousin to Firefox in that it can control the grid in two dimensions in addition to defining a rectangular layout. Research shows that most developers working with CSS are aware of Grid Layout and many are using it.
The subgrid value is a new feature in grid layout and is very useful. subgrid allows you to define a child grid that inherits the parent layout. This is different from nesting a grid display within another grid. In case of nesting, the child grid defines its own dimensions and spacing. When you use a subgrid, the parent's layout is applied, but you can override many aspects of the layout in the subgrid if necessary.
As of the time of writing this article, subgrid is implemented in Firefox 71 and higher and Safari 16 and higher.It's done. Google Chrome and Microsoft Edge are also on the roadmap and will be supported in the future. The subgrid value will be a very useful layout feature in the future.
accent-color option
Some display elements are traditionally difficult to style despite their common use. For example, checkboxes and radio buttons are often replaced with custom widgets that mimic the behavior of these elements while hiding the browser's implementation. You can specify elements like this using the new CSS accent-color option. For example, you can apply magenta to all radio buttons on the page as shown in <Example 3> ( see also the live example ).
No matter where the scroll movement is released, the y scroll position in <Example 4> automatically moves to the child element. This is because the scroll-snap-type property in the scroll container is set to y mandatory and the child element has a scroll-snap-align: start declaration. You can also modify this behavior. For example, you can set the scroll-snap-type property to proximity. As you might guess, this only causes snapping when the scroll gets close to the element. For reference, you can use the related overscroll-behavior property to define the behavior of nested scroll containers.
CSS logical properties (inline and block)
If you've ever tried to set container borders on the top and bottom or left and right, you've probably experienced the hassle of having to write border-left and border-right or border-top and border-bottom. The problem is that using the shortcut property inevitably affects borders that you don't want to touch. This inconvenience also applies to elements such as padding and margins.
The CSS Logical Properties module allows you to refer to elements abstractly using the inline and block keywords. Use inline for left and right, and block for top and bottom. For example, to set borders on the left and right sides of a div, you can use the code in <Example 5> ( see also the live example here ).
<Example 5> Left and right padding using logical inline
div {
border-inline: 10px dashed seagreen;
}
This is a useful shortcut for borders, but the inline and block logical keywords are also used for many other properties . Most developers use shortcuts like this for text direction and writing mode . In this case, properties like padding-inline-end allow you to specify trailing padding regardless of the active text direction. Basically, the abstraction to inline and block allows you to write generalized styles that apply to a variety of settings. See CSS Logical Properties and Values for more details .
container query
Container queries are now stable in CSS and implemented in all major browsers. Container queries have a huge impact on the way we think about responsive design. The basic idea is that you can set breakpoints based on the size of the viewport and media.
Grid is now fully supported Phone Number List and standardized across all browsers . Grid layout is indicated by the display: grid declaration, and can be said to be a kind of cousin to Firefox in that it can control the grid in two dimensions in addition to defining a rectangular layout. Research shows that most developers working with CSS are aware of Grid Layout and many are using it.
The subgrid value is a new feature in grid layout and is very useful. subgrid allows you to define a child grid that inherits the parent layout. This is different from nesting a grid display within another grid. In case of nesting, the child grid defines its own dimensions and spacing. When you use a subgrid, the parent's layout is applied, but you can override many aspects of the layout in the subgrid if necessary.
As of the time of writing this article, subgrid is implemented in Firefox 71 and higher and Safari 16 and higher.It's done. Google Chrome and Microsoft Edge are also on the roadmap and will be supported in the future. The subgrid value will be a very useful layout feature in the future.
accent-color option
Some display elements are traditionally difficult to style despite their common use. For example, checkboxes and radio buttons are often replaced with custom widgets that mimic the behavior of these elements while hiding the browser's implementation. You can specify elements like this using the new CSS accent-color option. For example, you can apply magenta to all radio buttons on the page as shown in <Example 3> ( see also the live example ).
No matter where the scroll movement is released, the y scroll position in <Example 4> automatically moves to the child element. This is because the scroll-snap-type property in the scroll container is set to y mandatory and the child element has a scroll-snap-align: start declaration. You can also modify this behavior. For example, you can set the scroll-snap-type property to proximity. As you might guess, this only causes snapping when the scroll gets close to the element. For reference, you can use the related overscroll-behavior property to define the behavior of nested scroll containers.
CSS logical properties (inline and block)
If you've ever tried to set container borders on the top and bottom or left and right, you've probably experienced the hassle of having to write border-left and border-right or border-top and border-bottom. The problem is that using the shortcut property inevitably affects borders that you don't want to touch. This inconvenience also applies to elements such as padding and margins.
The CSS Logical Properties module allows you to refer to elements abstractly using the inline and block keywords. Use inline for left and right, and block for top and bottom. For example, to set borders on the left and right sides of a div, you can use the code in <Example 5> ( see also the live example here ).
<Example 5> Left and right padding using logical inline
div {
border-inline: 10px dashed seagreen;
}
This is a useful shortcut for borders, but the inline and block logical keywords are also used for many other properties . Most developers use shortcuts like this for text direction and writing mode . In this case, properties like padding-inline-end allow you to specify trailing padding regardless of the active text direction. Basically, the abstraction to inline and block allows you to write generalized styles that apply to a variety of settings. See CSS Logical Properties and Values for more details .
container query
Container queries are now stable in CSS and implemented in all major browsers. Container queries have a huge impact on the way we think about responsive design. The basic idea is that you can set breakpoints based on the size of the viewport and media.