Setting Line Length in CSS (and Fitting Text to a Container)
The many ways to juggle line length when working with text... including two proposed properties that could make it easier in the future.
if()
function enables us to use values conditionally, but what exactly does if()
do? Let's look at a possible real-world use case. contrast-color()
function doesn’t check color contrast, but rather it outright resolves to either black or white (whichever one contrasts the most with your chosen color). Safari Technology Preview recently implemented it and we explore its possible uses in this article. scroll-marker-group
CSS property determines if the ::scroll-marker-group
pseudo-element is generated within the scroll container that the property is set on, and where. ::scroll-marker-group
pseudo-element holds the scroll markers generated by the ::scroll-marker
pseudo-element. When clicked on, these scroll markers scroll users to a corresponding scroll target within a scroll container in a scroll-snapping fashion. All in all, scroll markers give users an additional way to navigate overflow content. :target-current
CSS pseudo-class selects active scroll markers, meaning it’s only valid when used with the ::scroll-marker
pseudo-element The ::scroll-button()
pseudo-element adds accessible scroll buttons to scroll containers, giving users an additional way to navigate overflow content. To create a scroll button, simply specify a scroll direction while using the pseudo-element, and then declare the button’s content using …
::scroll-marker
pseudo-element adds accessible scroll markers to scroll containers.