- author: Kevin Powell
Exploring the State of CSS 2023 Survey
In this article, we will be diving into the State of CSS 2023 survey. The survey aims to gauge people's current knowledge and usage of newer CSS features, as well as their opinions on frameworks, libraries, and authoring solutions.
Before we get started, it is recommended to answer the survey on your own at The State of CSS website to get an idea of your current understanding of CSS features and concepts.
The survey consists of the following sections:
- Animation and Transition
- Colors and Backgrounds
- Other Features
The survey also includes code examples to help contextualize the questions. A new feature added to the survey is the "Reading List," which allows participants to save unfamiliar concepts for further research.
Subgrid is a CSS Grid layout feature that allows child elements to align with the parent grid. This feature will be available on all browsers in August. It is highly recommended to take a look at this feature as it can simplify and streamline the grid layout process.
Logical Properties replace using top, bottom, left, and right. This feature follows the writing mode, which means that if the writing mode is changed, the logical properties will follow those switches. It also replaces widths and heights with "inline size" and "block size."
Flexbox gap, as the name suggests, is a gap property applicable in flexbox layouts that allows for an easy and clean way to add space between flex items.
Container Queries is one of the most anticipated CSS features that allow the styling of elements based on their container size rather than the viewport size. Although not yet fully supported, Container Queries can be tested in some browsers with experimental flags.
Dynamic viewports are particularly useful in mobile devices, as they account for the viewport size when elements such as address bars move away. A good example of this is the dvh unit, which stands for dynamic viewport height and automatically adjusts based on the visible space.
New and Exciting CSS Properties for Web Developers
If you're a front-end developer, it's no secret that staying up-to-date with the latest CSS properties is essential. With new properties being added all the time, it can be challenging to keep track of all of them. In this article, we'll cover some of the latest and most exciting CSS properties that web developers should be aware of.
Dynamic Viewport Height (dvh)
Viewport size changes can present challenges for web developers when it comes to responsive design. Dynamic Viewport Height (dvh) is a new CSS property that adjusts based on whether the user interface (UI) is visible or not, making it an ideal solution for responsive design issues.
There are several variations of dvh, including:
- S for small viewport, which assumes the UI is always visible
- L for large viewport, which assumes the UI is not there
- Dynamic, which adjusts based on whether the UI is visible or not
While dvh is not perfect and may not provide a smooth transition, it does help to fix some of the problems web developers commonly encounter on iOS.
Anchor positioning is a new CSS property introduced in 2023 (despite the name's implicit suggestion of novelty). This property allows for the creation of slider links, but the exact functionality is currently unclear. Nonetheless, it is interesting to note that this property is available, and there is potential for uses in video and images.
Shapes and Graphics
Shapes and graphics are integral elements of modern web design, and CSS has recently added some exciting properties to enhance their design. Some of the most notable properties include:
- Mix Blend Modes: This property is useful for blending graphics and colors and has a wide range of use cases.
- Isolation: This property creates a new stack context, which is helpful when working with blend modes.
- Filters and Effects: These properties, such as blur and backdrop filters, are great for creating a variety of visual effects.
Linear Easing Function
The linear easing function is a straightforward yet powerful CSS property that allows web developers to create better easing functions. This property is ideal for situations where you want something to bounce or move in a specific way without using keyframe animation.
Intrinsic sizing includes several properties: Max Content, Min Content, and Fit Content. These properties are useful for defining content size based on the content itself, rather than predefined values. Particularly useful is the Fit Content property.
Conic gradients initially appear as circular gradients. Still, they are useful for creating complex patterns: conic gradients have a wide range of applications, including pie chart designs.
Advanced color properties are useful for creating more vivid, more varied colors in web design. Some of the most notable properties include:
- Color Modes: You can now choose the color mode according to your needs.
- Accent Color: This property is useful for changing the color of checkboxes, radio buttons, sliders and other interactive elements.
- Parent Color: This is what helped introduce custom properties into CSS.
Color Mix is a new CSS property that allows for the mixing of two different colors together. While this is not a new concept, having it now native to CSS without the need to use preprocessors like Sass or Less is a big step for CSS.
Exploring New CSS Color Features
CSS is constantly evolving and adding new features that allow developers to create more complex and exciting designs. In this article, we will explore some of the new CSS color features that are currently available or on their way.
Mixing colors is a new CSS feature that allows developers to create new shades or tints by combining two different colors. This feature opens up a whole new world of possibilities for designers. Some of the advantages of mixing colors include:
- The ability to choose different color modes when mixing colors.
- The option to add shades or tints to a hex code by simply adjusting the amount of white or black in the color.
- The capability to combine two colors to create a unique color.
Currently supported in some browsers, mixing colors is set to become an essential tool in any developer's arsenal.
Choosing Color Models
The HSL color model has been around for some time, but the new LCH model is emerging as a more human-friendly alternative. LCH handles color perception in a better way and is much easier to use.
Other color models, such as the OK ones, offer new and exciting possibilities for developers to explore.
Interpolation Color Spaces
Interpolation color spaces offer the ability to create gradients between two colors. However, the way the colors are calculated and displayed can differ greatly between color models. For example, the same gradient in five different color spaces will look entirely different.
Developers can use Interpolation color spaces to create different gradients for different color models by specifying a specific space for each gradient.
Scroll and Touch Actions
Other CSS features, such as scroll snap, over-scroll behavior, and touch actions, offer developers more control over how users navigate and interact with web pages. For example, over-scroll behavior can prevent unexpected scrolling when users scroll beyond an element's boundaries.
Font display is a CSS feature that allows developers to control how fonts are loaded and displayed on a web page. This feature can improve page loading times and reduce the amount of time users spend waiting for content to appear.
Line clamp is a useful CSS feature that allows developers to limit the number of lines displayed in an element. This feature can make text more readable and prevent long paragraphs from looking cluttered.
Exploring CSS Features
CSS is a powerful tool for styling web pages and creating engaging user experiences. In this article, we'll take a closer look at some of the lesser-known CSS features that can help make your website stand out from the crowd.
Font Display Fallback
Have you ever visited a website where the font is slow to load, leaving you looking at blank spaces instead of the intended text? Font display fallback can help prevent this frustration. By using the font-display property, you can specify how the font should load and fallback to a system font if the custom font isn't ready yet. With fewer blank spaces, users will be able to engage more easily with your content.
Sometimes you want to display just a few lines of text, with an ellipsis at the end to indicate there's more to read if the user desires. Line clamp allows you to specify the number of lines to display before adding the ellipsis. This feature is especially handy for cards or other containers with dynamic content.
Variable fonts are a relatively new addition to the web design toolkit. With just one font file, you get a variety of weights, styles, and other customizable features. This is a major advantage, as it saves on file size and gives designers greater flexibility in creating engaging typography. Variable fonts can truly elevate your website design.
If you've ever wished you could set colors for individual parts of a font, font palettes are the feature for you. You can use them to control the colors of colored fonts (fonts that contain multiple colors), making them ideal for display typefaces. Though there are few color fonts currently available, font palettes allow for more extensive customization of these types of fonts.
Text Drop Balance
Text Drop Balance is a feature that helps balance out text within a container by adjusting the spacing between letters. Though it only works on text and is limited to a maximum of four lines, this feature can be especially useful for headlines or other large blocks of text.
Prefers Reduced Motion
Some users may prefer less animation or motion on websites due to a preference or disability. The prefers-reduced-motion feature allows for web designers to respect those preferences by reducing the amount of animation on their website. This feature allows for greater accessibility and inclusivity.
Prefers Reduced Data
In an age where not all users have access to unlimited data plans, designing websites that are mindful of data usage is important. The prefers-reduced-data feature helps web developers achieve this goal by allowing them to design sites that use less data. One method involves using the system UI font instead of a custom font, which can be much smaller in size. This ensures that users on metered connections don't get hit with unexpected data charges.
For users with certain disabilities, seeing high contrast is essential. By using the prefers-contrast feature, web developers can design sites optimized for high contrast, making them easier to read and engage with.
For users with even more extensive disabilities, such as color blindness, forced colors can help ensure that their web experience is as good as possible. When a user sets their system to high contrast mode or another similar setting, forced colors help ensure that the website's colors remain usable and legible.
Finally, it's important to ensure that clickable elements on your website are easily navigable, especially for users who rely on keyboard input. The focus-visible feature helps designers achieve this by making it clear which element is currently in focus. With this feature, users will never have to guess which clickable element on your website they're going to select.
By taking advantage of these lesser-known CSS features, you can make your website more accessible, engaging, and inclusive. Whether you're designing for users with disabilities or simply looking for ways to differentiate your website from the competition, exploring these features will help take your website design to the next level.
CSS Properties You Might Not Know Yet
CSS is a constantly evolving language, and with each new update come new properties and features that can make our lives as developers easier. In this article, we'll go over some CSS properties you might not yet have familiarized yourself with, but could be useful in a variety of contexts.
Custom Properties or CSS Variables
Custom properties, also known as CSS variables, have been around for some time now, but they're still not as widely used as they could be. They allow you to declare and register custom properties with additional information, making them much easier to use and style consistently. You can even animate these properties, allowing for some exciting design possibilities. To check for browser support, use the
@property rule allows you to specify the type of a custom property, such as whether it's a color or a number. This added specificity can be especially useful when animating custom properties. Currently, the
@property rule is supported in Safari but not in Firefox.
The marker property is a straightforward way to change the style and color of bullet points or numbers in a list. However, its functionality is quite limited, and it can only be used to style specific elements in a list.
Container Queries are a new feature that will change the way we think about designing responsive layouts. With Container Queries, we can style parent elements of a specific size based on the content of their child elements. This is a significant departure from the traditional method of styling elements based on the viewport size.
Cascade Layers allow you to organize your CSS code based on specificity. However, they're still a relatively new feature, and not all developers have had the opportunity to use them in their projects yet.
Trigonometric functions have been newly introduced into CSS, opening up the possibility of animating circular elements and other interesting design features.
Nesting in CSS is a way to organize and structure your code logically, making it easier to read and maintain. It's similar to using an ampersand in SASS, but with more functionality and specificity. However, it's not quite the same as using a cascade layer, and it will likely be supported independently of that feature.
Image Set is similar to the Source Set for images, allowing you to define alternative images for different screen sizes and resolutions in CSS. This can help improve site performance by only loading in the necessary images.
The View Box property can be used to define an element's position, width, and height in relation to its parent container. It's currently not widely supported by browsers, but it could be a useful property to keep an eye on as it gains more traction.
Individual Transform Properties
Finally, Individual Transform Properties allow you to assign specific values for transforms such as translate, rotate, and scale separately. This can make your code much more readable and organized.
Overall, while you may not use all of these properties in every project you work on, it's essential to stay aware of what's available in the evolving world of CSS. Utilizing these lesser-known CSS properties can enable you to create new and exciting designs and improve the maintainability of your code.
Transform Properties in CSS: Are They Worth Using?
In CSS, there are several properties that we can use to transform elements on a webpage. These include translate, rotate, scale, and skew. However, some developers are divided on whether or not these transform properties are worth using.
Transform Properties: Values or Properties?
One point of confusion is whether the transform properties should be considered as values or properties. The reality is that they are values that can be used within the transform property.
Translate, Rotate, and Scale: Now Their Own Properties
Initially, only the skew value was included within the transform property. However, developers spoke out and eventually, translate, rotate, and scale were also made into their own properties.
The Debate Over Using Transform Properties
Some developers recommend avoiding the transform properties altogether. However, others use them frequently for the sake of saving time. An interesting trick was mentioned by Amit Sheen (known for his work on animations and 3D design) where you can "transform rotate" an object and then apply the "rotate function" to it. Although this might not be practical for production, it was still a cool technique to use.
Surveying Developer Opinions
To get a better understanding of where developers stand on this issue, there is a survey available for anyone to take. This survey covers not only transform properties but also other tools, frameworks, and CSS usage. It was created by Sasha and his team, and the more people who take it, the better the sample will be. By taking the survey, you can give feedback to the browsers and let them know what features people are interested in.
The state of css 2023 survey is a valuable resource for web developers to stay up-to-date with css concepts and features. by exploring the survey and the notable features discussed here, we hope that you will gain a deeper understanding of css and its capabilities.
These are just a few of the latest and most exciting css properties added to the web development world in recent years. incorporating these properties into your web designs can help create a more engaging and interactive user experience. keep learning and stay up-to-date with these new css properties to stay ahead of the curve in web development.
Css offers a range of new features that allow developers to create more complex and exciting designs. from mixing colors to controlling how fonts are loaded, these new features are set to transform the way we design and develop websites.
: Decide for Yourself
In the end, the decision of whether or not to use transform properties in CSS is up to each developer. It's important to consider the opinions of others but ultimately, it's your choice whether or not to use them. So go ahead and take the survey to gain a better understanding of where everyone stands, and make your own decision based on what works best for your projects. And as always, don't forget to make your mark on the internet and make it just a little bit more awesome.