{"id":32336,"date":"2025-03-03T14:50:31","date_gmt":"2025-03-03T13:50:31","guid":{"rendered":"https:\/\/www.codemotion.com\/magazine\/?p=32336"},"modified":"2025-03-03T14:50:32","modified_gmt":"2025-03-03T13:50:32","slug":"native-css","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/","title":{"rendered":"Native CSS: A Whole New Story \u2013 Part 1"},"content":{"rendered":"\n<p>In this article, I\u2019ll explain why I personally love it more and more. We&#8217;ll explore how CSS has evolved in recent years, incorporating many features previously available only through preprocessors like SASS and LESS.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-css-nesting\">CSS Nesting<\/h2>\n\n\n\n<p>CSS Nesting is a recently introduced feature that allows for more readable and concise nested rules, similar to what was previously only possible with preprocessors like SASS or LESS.<\/p>\n\n\n\n<p>Now, you no longer need preprocessors to write nested styles. By default, you can structure CSS like this:<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">article {\n  color: black;\n\n  &amp; h1 {\n    font-size: 2rem;\n  }\n\n  &amp; p {\n    line-height: 1.5;\n  }\n}\n<\/code><\/span><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-do-browsers-say\">What Do Browsers Say?<\/h2>\n\n\n\n<p>Here\u2019s an overview of browser compatibility (as of January 2025):<\/p>\n\n\n\n<p><a href=\"https:\/\/caniuse.com\/css-nesting\">Browser support for CSS Nesting<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-scope\">What is @scope?<\/h2>\n\n\n\n<p>The <code>@scope<\/code> rule allows you to define a specific context or scope for CSS selectors. Instead of applying styles globally or relying on specificity battles, you can limit the effect of styles to a targeted section of the DOM.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-keyword\">@scope<\/span> (section) {\n  <span class=\"hljs-selector-tag\">h1<\/span> {\n    <span class=\"hljs-attribute\">color<\/span>: blue;\n  }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this case, only <code>h1<\/code> elements inside <code>section<\/code> tags will have the blue color. This feature provides better modularity and scoping for CSS styles.<\/p>\n\n\n\n<p>Check the latest browser support here: <a href=\"https:\/\/caniuse.com\/css-cascade-scope\">@scope browser support<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-layer\">What is @layer?<\/h2>\n\n\n\n<p>The <code>@layer<\/code> rule allows you to define CSS layers with hierarchical priorities. It helps organize styles into structured sections and ensures that more important rules take precedence, even if defined later in the stylesheet.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-keyword\">@layer<\/span> base {\n  <span class=\"hljs-selector-tag\">h1<\/span> {\n    <span class=\"hljs-attribute\">color<\/span>: blue;\n  }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Now, let\u2019s consider a case where order matters:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-keyword\">@layer<\/span> utilities {\n  <span class=\"hljs-selector-tag\">h1<\/span> {\n    <span class=\"hljs-attribute\">color<\/span>: green;\n  }\n}\n\n<span class=\"hljs-keyword\">@layer<\/span> base {\n  <span class=\"hljs-selector-tag\">h1<\/span> {\n    <span class=\"hljs-attribute\">color<\/span>: blue;\n  }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Since <code>utilities<\/code> is declared first, it takes priority over <code>base<\/code>, even though <code>base<\/code> appears later in the stylesheet.<\/p>\n\n\n\n<p><a href=\"https:\/\/caniuse.com\/css-cascade-layers\" target=\"_blank\" rel=\"noreferrer noopener\">Check @layer browser support<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-color-scheme\">Color Scheme<\/h2>\n\n\n\n<p>Modern operating systems, browsers, and applications support both dark and light modes. CSS addresses this with the <code>@media<\/code> query <code>prefers-color-scheme<\/code>.<\/p>\n\n\n\n<p>With this query, you can define variables and styles for different themes.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-pseudo\">:root<\/span> {\n  <span class=\"hljs-attribute\">--background-color<\/span>: white;\n  <span class=\"hljs-attribute\">--text-color<\/span>: black;\n}\n\n<span class=\"hljs-keyword\">@media<\/span> (<span class=\"hljs-attribute\">prefers-color-scheme:<\/span> dark) {\n  <span class=\"hljs-selector-pseudo\">:root<\/span> {\n    <span class=\"hljs-attribute\">--background-color<\/span>: black;\n    <span class=\"hljs-attribute\">--text-color<\/span>: white;\n  }\n}\n\n<span class=\"hljs-selector-tag\">body<\/span> {\n  <span class=\"hljs-attribute\">background-color<\/span>: <span class=\"hljs-built_in\">var<\/span>(--background-color);\n  <span class=\"hljs-attribute\">color<\/span>: <span class=\"hljs-built_in\">var<\/span>(--text-color);\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/caniuse.com\/?search=prefers-color-scheme\" target=\"_blank\" rel=\"noreferrer noopener\">Check prefers-color-scheme browser support<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-is-and-has\">:is and :has<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-is\">:is<\/h3>\n\n\n\n<p>The <code>:is()<\/code> pseudo-class allows for shorter, more readable selectors by grouping multiple selectors into a single declaration.<\/p>\n\n\n\n<p>Before:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">section<\/span> <span class=\"hljs-selector-tag\">h1<\/span>, <span class=\"hljs-selector-tag\">article<\/span> <span class=\"hljs-selector-tag\">h1<\/span> {\n  <span class=\"hljs-attribute\">font-size<\/span>: <span class=\"hljs-number\">2rem<\/span>;\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>After:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-pseudo\">:is(section<\/span>, <span class=\"hljs-selector-tag\">article<\/span>) <span class=\"hljs-selector-tag\">h1<\/span> {\n  <span class=\"hljs-attribute\">font-size<\/span>: <span class=\"hljs-number\">2rem<\/span>;\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-has\">:has<\/h3>\n\n\n\n<p>The <code>:has()<\/code> pseudo-class is a relational selector that applies styles to an element based on its children, descendants, or even adjacent siblings.<\/p>\n\n\n\n<p>Example: Apply a border only to <code>div<\/code> elements that contain a <code>p<\/code> tag.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css\"><span class=\"hljs-selector-tag\">div<\/span><span class=\"hljs-selector-pseudo\">:has(p)<\/span> {\n  <span class=\"hljs-attribute\">border<\/span>: <span class=\"hljs-number\">2px<\/span> solid blue;\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>In recent years, <a href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/css-is-cool-explore-these-5-repositories\/\" target=\"_blank\" rel=\"noreferrer noopener\">CSS has evolved tremendously<\/a>, integrating features that were once exclusive to preprocessors like SASS or LESS.<\/p>\n\n\n\n<p>The introduction of CSS Nesting, <code>@scope<\/code>, <code>@layer<\/code>, and powerful pseudo-classes like <code>:is<\/code> and <code>:has<\/code> has made the language more robust and flexible, allowing developers to write more structured, readable, and modular code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-key-takeaways\">Key takeaways:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>CSS Nesting<\/strong> eliminates the need for preprocessors for writing nested rules, simplifying stylesheet structures.<\/li>\n\n\n\n<li><strong>@scope<\/strong> introduces better scoping, enhancing CSS modularity.<\/li>\n\n\n\n<li><strong>@layer<\/strong> helps define styling hierarchies, preventing conflicts and improving maintainability.<\/li>\n\n\n\n<li><strong><code>prefers-color-scheme<\/code><\/strong> natively supports dark and light mode, catering to modern design accessibility.<\/li>\n\n\n\n<li><strong><code>:is<\/code> and <code>:has<\/code><\/strong> enhance selector power, making CSS more expressive and efficient.<\/li>\n<\/ul>\n\n\n\n<p>While some of these features are not yet fully supported across all browsers, the landscape is changing rapidly. Now is the perfect time to start experimenting and preparing your projects for the future of web development.<\/p>\n\n\n\n<p>Stay tuned for the next article in this series, where we\u2019ll dive into topics like <code>zoom<\/code>, <code>text-wrap<\/code>, and much more!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I\u2019ll explain why I personally love it more and more. We&#8217;ll explore how CSS has evolved in recent years, incorporating many features previously available only through preprocessors like SASS and LESS. CSS Nesting CSS Nesting is a recently introduced feature that allows for more readable and concise nested rules, similar to what&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/\">Read more<\/a><\/p>\n","protected":false},"author":320,"featured_media":32324,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[6,31],"tags":[],"collections":[],"class_list":{"0":"post-32336","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-frontend","8":"category-web-developer","9":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Native CSS: A Whole New Story \u2013 Part 1<\/title>\n<meta name=\"description\" content=\"In this article, I&#039;ll try to explain why I love Native CSS more and more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Native CSS: A Whole New Story \u2013 Part 1\" \/>\n<meta property=\"og:description\" content=\"In this article, I&#039;ll try to explain why I love Native CSS more and more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-03T13:50:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-03T13:50:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1792\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Daniele Carta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniele Carta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/\"},\"author\":{\"name\":\"Daniele Carta\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/724604c312f972c01bbd0192c1b75a53\"},\"headline\":\"Native CSS: A Whole New Story \u2013 Part 1\",\"datePublished\":\"2025-03-03T13:50:31+00:00\",\"dateModified\":\"2025-03-03T13:50:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/\"},\"wordCount\":497,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp\",\"articleSection\":[\"Frontend\",\"Web Developer\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/\",\"name\":\"Native CSS: A Whole New Story \u2013 Part 1\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp\",\"datePublished\":\"2025-03-03T13:50:31+00:00\",\"dateModified\":\"2025-03-03T13:50:32+00:00\",\"description\":\"In this article, I'll try to explain why I love Native CSS more and more.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp\",\"width\":1792,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/native-css\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Frontend\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/frontend\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Native CSS: A Whole New Story \u2013 Part 1\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Codemotion.Italy\\\/\",\"https:\\\/\\\/x.com\\\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/724604c312f972c01bbd0192c1b75a53\",\"name\":\"Daniele Carta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/18217293-100x100.png\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/18217293-100x100.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/18217293-100x100.png\",\"caption\":\"Daniele Carta\"},\"description\":\"With over 10 years of experience in the IT industry, I am currently the Head of Frontend at AltermAInd, where I lead strategies and innovations in the field of front-end development.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/daniele-carta-milano\\\/\"],\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/author\\\/crtdaniele\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Native CSS: A Whole New Story \u2013 Part 1","description":"In this article, I'll try to explain why I love Native CSS more and more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/","og_locale":"en_US","og_type":"article","og_title":"Native CSS: A Whole New Story \u2013 Part 1","og_description":"In this article, I'll try to explain why I love Native CSS more and more.","og_url":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2025-03-03T13:50:31+00:00","article_modified_time":"2025-03-03T13:50:32+00:00","og_image":[{"width":1792,"height":1024,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp","type":"image\/webp"}],"author":"Daniele Carta","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Daniele Carta","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/"},"author":{"name":"Daniele Carta","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/724604c312f972c01bbd0192c1b75a53"},"headline":"Native CSS: A Whole New Story \u2013 Part 1","datePublished":"2025-03-03T13:50:31+00:00","dateModified":"2025-03-03T13:50:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/"},"wordCount":497,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp","articleSection":["Frontend","Web Developer"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/","url":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/","name":"Native CSS: A Whole New Story \u2013 Part 1","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp","datePublished":"2025-03-03T13:50:31+00:00","dateModified":"2025-03-03T13:50:32+00:00","description":"In this article, I'll try to explain why I love Native CSS more and more.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp","width":1792,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/frontend\/native-css\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"Frontend","item":"https:\/\/www.codemotion.com\/magazine\/frontend\/"},{"@type":"ListItem","position":3,"name":"Native CSS: A Whole New Story \u2013 Part 1"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/724604c312f972c01bbd0192c1b75a53","name":"Daniele Carta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/03\/18217293-100x100.png","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/03\/18217293-100x100.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/03\/18217293-100x100.png","caption":"Daniele Carta"},"description":"With over 10 years of experience in the IT industry, I am currently the Head of Frontend at AltermAInd, where I lead strategies and innovations in the field of front-end development.","sameAs":["https:\/\/www.linkedin.com\/in\/daniele-carta-milano\/"],"url":"https:\/\/www.codemotion.com\/magazine\/author\/crtdaniele\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-600x400.webp","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-600x600.webp","author_info":{"display_name":"Daniele Carta","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/crtdaniele\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp",1792,1024,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-150x150.webp",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-300x171.webp",300,171,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-768x439.webp",768,439,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-1024x585.webp",1024,585,true],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-1536x878.webp",1536,878,true],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u.webp",1792,1024,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-100x100.webp",100,100,true],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-180x128.webp",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-896x504.webp",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-400x225.webp",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-600x400.webp",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2025\/02\/DALL\u00b7E-2025-03-03-10.28.45-Unillustrazione-concettuale-che-rappresenta-il-CSS-Nativo.-Limmagine-mostra-uninterfaccia-di-sviluppo-con-codice-CSS-visibile-su-uno-schermo-con-u-600x600.webp",600,600,true]},"uagb_author_info":{"display_name":"Daniele Carta","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/crtdaniele\/"},"uagb_comment_info":0,"uagb_excerpt":"In this article, I\u2019ll explain why I personally love it more and more. We&#8217;ll explore how CSS has evolved in recent years, incorporating many features previously available only through preprocessors like SASS and LESS. CSS Nesting CSS Nesting is a recently introduced feature that allows for more readable and concise nested rules, similar to what&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/32336","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/320"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=32336"}],"version-history":[{"count":2,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/32336\/revisions"}],"predecessor-version":[{"id":32338,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/32336\/revisions\/32338"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/32324"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=32336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=32336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=32336"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=32336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}