{"id":2073,"date":"2019-09-27T13:17:57","date_gmt":"2019-09-27T11:17:57","guid":{"rendered":"https:\/\/www.thecodecampus.de\/blog\/?p=2073"},"modified":"2025-04-22T10:27:11","modified_gmt":"2025-04-22T08:27:11","slug":"css-custom-properties-variables","status":"publish","type":"post","link":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/","title":{"rendered":"CSS Custom Properties (Variables)"},"content":{"rendered":"<p>CSS Custom Properties is the formally correct name for the more commonly used synonym CSS variables. In this article we want to give you an insight how CSS variables help you to make CSS files more structured and semantically understandable, and how to modify them easily with JavaScript.<\/p>\n<p>Documents or applications of any size contain many lines of CSS code. For example, the same color might be used in hundreds of different places, requiring global search and replace if that color needs to change. With CSS custom properties cascading variables can be defined as new primitive value type. They\u2019re typically used to store colors, font names, font sizes, length units, etc.<\/p>\n<p>Compared to preprocessor variables like Sass or Less, which have to be compiled into normal CSS to be read by the browser, CSS variables are real live CSS properties running in the browser. They can be changed in: Stylesheet documents, inline style attributes, SVG presentational attributes, media queries, animations and transitions. All this can also be manipulated via JavaScript. This opens up a whole world of possibilities!<\/p>\n<p>However, this does not mean that you have to choose between one or the other. Take advantage of the CSS variables and preprocessor variables and let them work together.<\/p>\n<h3><strong>Browser Support<\/strong><\/h3>\n<p><a href=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2084\" src=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png\" alt=\"\" width=\"1405\" height=\"235\" srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png 1405w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport-300x50.png 300w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport-768x128.png 768w, https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport-1024x171.png 1024w\" sizes=\"auto, (max-width: 1405px) 100vw, 1405px\" \/><\/a><br \/>\n<em>(references: BrowserSupport 20.09.2019 <a href=\"https:\/\/caniuse.com\/#search=css%20variables\">https:\/\/caniuse.com\/#search=css%20variables<\/a>)<\/em><\/p>\n<h3><strong>Syntax<\/strong><\/h3>\n<p>Initialize variable:<br \/>\nCustom properties starts with two hyphens (-) like <code>--color<\/code>.<\/p>\n<pre class=\"lang:css decode:true\">element { --color: red; }<\/pre>\n<p>and accessed using <code>var()<\/code>:<\/p>\n<pre class=\"lang:css decode:true\">element {\r\n    color: var(--color);\r\n}<\/pre>\n<p><strong>Attention<\/strong>: unlike other CSS properties, custom properties are <em>case-sensitive<\/em>!<br \/>\nFor instance, <code>var(--foo)<\/code> and <code>var(--FOO)<\/code> refer to two different custom properties, <code>--foo<\/code> and <code>--FOO<\/code> respectively.<\/p>\n<p>Custom properties are inherited. This means that if no value is set for a custom property on a particular element, the value of the parent element is used. As the following example illustrates:<\/p>\n<pre class=\"lang:css decode:true\">:root { --color: blue; }\r\ndiv { --color: green; }\r\n#alert { --color: red; }\r\n* { color: var(--color); }\r\n\r\n&lt;p&gt;I inherited blue from the root element!&lt;\/p&gt;\r\n&lt;div&gt;I got green set directly on me!&lt;\/div&gt;\r\n&lt;div id='alert'&gt;\r\n  While I got red set directly on me!\r\n  &lt;p&gt;I\u2019m red too, because of inheritance!&lt;\/p&gt;\r\n&lt;\/div&gt;<\/pre>\n<p><a href=\"https:\/\/www.thecodecampus.de\/schulungen\/angular\" style=\"display: inline-block;\">\n<picture><source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_big.png\" media=\"(min-width: 1024px)\"><source srcset=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_medium.png\" media=\"(min-width: 600px)\"><img decoding=\"async\" src=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2025\/04\/angular-schulungen_anne_WP_small.png\" alt=\"Angular Schulungen\" class=\"alignnone size-full wp-image-38\">\n<\/picture>\n<\/a><\/p>\n<h3>CSS Variables in JavaScript<\/h3>\n<p>In JavaScript there are many methods (see references) to use the values of custom properties. It is useful to know that JavaScript initialized the variable in HTML as inline style.<\/p>\n<p>In this CodePen example the variable <code>--color<\/code> is globally initialized.<\/p>\n<p><iframe height=\"265\" style=\"width: 100%;\" scrolling=\"no\" title=\"OJLqOqp\" src=\"https:\/\/codepen.io\/Ol1ver\/embed\/OJLqOqp?height=265&amp;theme-id=0&amp;default-tab=js,result\" frameborder=\"no\" allowtransparency=\"true\" allowfullscreen=\"allowfullscreen\"><br \/>\nSee the Pen <a href=\"https:\/\/codepen.io\/Ol1ver\/pen\/OJLqOqp\">OJLqOqp<\/a> by Oliver<br \/>\n(<a href=\"https:\/\/codepen.io\/Ol1ver\">@Ol1ver<\/a>) on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<br \/>\n<\/iframe><\/p>\n<p>After clicking the button the color changes to blue.<br \/>\nWith <code>setProperty('--color', 'blue')<\/code> the following was initialized in the HTML file:<\/p>\n<pre class=\"lang:css decode:true\">&lt;html style='--color:blue;'&gt;<\/pre>\n<p>With <code>removeProperty('--color')<\/code> this inline style is deleted from the html file and the value initialized in the CSS file is used again.<\/p>\n<p>Now that we know how JavaScript handles the variables we have to consider the following with the <code>getPropertyValue()<\/code> method.<\/p>\n<pre class=\"lang:js decode:true\">\/\/ get variable from inline style\r\ndocument.documentElement.style.getPropertyValue('--color')<\/pre>\n<p>If you call <code>getPropertyValue()<\/code> before you set it with JavaScript. You get the value &#8220;null&#8221;, because there is no inline style defined in the HTML file.<br \/>\nAfter you have clicked the button you get the value blue.<\/p>\n<p>Workaround (getting styles like this wouldn&#8217;t be considered best practice):<\/p>\n<pre class=\"lang:js decode:true\">\/\/ get variable from wherever (But be careful with this, because its computed!)\r\ngetComputedStyle(element).getPropertyValue('--color');\r\n\r\n\/\/ queries the value of the --color property in a CSS selector rule\r\ndocument.styleSheets[0].cssRules[0].style.getPropertyValue('--color');<\/pre>\n<h3>Fallback and Invalid variables<\/h3>\n<p>As fallback, a unique definition after the CSS variable can be noted:<\/p>\n<pre class=\"lang:css decode:true\">element { color: var(--color, red); }<\/pre>\n<p>The CSS function <code>var()<\/code> contains a comma-separated fixed value in addition to the variable name. If the variable does not exist, it is used.<br \/>\n<strong>Attention:<\/strong> Older browsers that do not understand var() also ignore this statement.<\/p>\n<p>When the browser encounters an invalid\u00a0<code>var()<\/code> substitution, the initial or inherited value of the property is used, going back to the browser&#8217;s default settings.<\/p>\n<h3>Internet Explorer integration<\/h3>\n<p>CSS Custom Properties (Variables) are not supported in Internet Explorer, it is possible to use a postCSS plugin that adds the property with its value to each element.<\/p>\n<p><a href=\"https:\/\/github.com\/postcss\/postcss-custom-properties\">https:\/\/github.com\/postcss\/postcss-custom-properties<\/a><\/p>\n<pre class=\"\">:root {\r\n  --color: red;\r\n}\r\n\r\nh1 {\r\n  color: var(--color);\r\n}\r\n\r\n\/* becomes *\/\r\n\r\n:root {\r\n  --color: red;\r\n}\r\n\r\nh1 {\r\n  color: red;\r\n  color: var(--color);\r\n}<\/pre>\n<h3>References<\/h3>\n<ul>\n<li>CSS Variables: <a href=\"https:\/\/www.w3.org\/TR\/css-variables-1\/\">https:\/\/www.w3.org\/TR\/css-variables-1\/<\/a><\/li>\n<li>JavaScript Methodes for CSS Variables: <a href=\"https:\/\/www.w3.org\/2003\/01\/dom2-javadoc\/org\/w3c\/dom\/css\/CSSStyleDeclaration.html?is-external=true\">https:\/\/www.w3.org\/2003\/01\/dom2-javadoc\/org\/w3c\/dom\/css\/CSSStyleDeclaration.html?is-external=true<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>CSS Custom Properties is the formally correct name for the more commonly used synonym CSS variables. In this article we want to give you an insight how CSS variables help you to make CSS files more structured and semantically understandable, and how to modify them easily with JavaScript. Documents or applications of any size contain [&#8230;]<br \/><a class=\"meta-big\" href=\"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/\"> READ MORE<\/a><\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94,2],"tags":[],"class_list":["post-2073","post","type-post","status-publish","format-standard","hentry","category-css","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CSS Custom Properties (Variables) - Web Development Blog<\/title>\n<meta name=\"description\" content=\"Elevate CSS styling! Unleash the power of custom properties (variables). Enhance flexibility and design control. Level up your web styling now!\" \/>\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.thecodecampus.de\/blog\/css-custom-properties-variables\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS Custom Properties (Variables) - Web Development Blog\" \/>\n<meta property=\"og:description\" content=\"Elevate CSS styling! Unleash the power of custom properties (variables). Enhance flexibility and design control. Level up your web styling now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Development tips and tricks - theCodeCampus Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-27T11:17:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-22T08:27:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1405\" \/>\n\t<meta property=\"og:image:height\" content=\"235\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"theCodeCampus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"theCodeCampus\" \/>\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.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/\"},\"author\":{\"name\":\"theCodeCampus\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/276bbda2f8da73154f22fb652201cfbc\"},\"headline\":\"CSS Custom Properties (Variables)\",\"datePublished\":\"2019-09-27T11:17:57+00:00\",\"dateModified\":\"2025-04-22T08:27:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/\"},\"wordCount\":587,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/BrowserSupport.png\",\"articleSection\":[\"CSS\",\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/\",\"name\":\"CSS Custom Properties (Variables) - Web Development Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/BrowserSupport.png\",\"datePublished\":\"2019-09-27T11:17:57+00:00\",\"dateModified\":\"2025-04-22T08:27:11+00:00\",\"description\":\"Elevate CSS styling! Unleash the power of custom properties (variables). Enhance flexibility and design control. Level up your web styling now!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/BrowserSupport.png\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/09\\\/BrowserSupport.png\",\"width\":1405,\"height\":235},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/css-custom-properties-variables\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS Custom Properties (Variables)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"name\":\"Web Development tips and tricks - theCodeCampus Blog\",\"description\":\"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#organization\",\"name\":\"theCodeCampus\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch.jpg\",\"width\":156,\"height\":156,\"caption\":\"theCodeCampus\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/#\\\/schema\\\/person\\\/276bbda2f8da73154f22fb652201cfbc\",\"name\":\"theCodeCampus\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg\",\"caption\":\"theCodeCampus\"},\"description\":\"Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/showcase\\\/thecodecampus\\\/\"],\"url\":\"https:\\\/\\\/www.thecodecampus.de\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CSS Custom Properties (Variables) - Web Development Blog","description":"Elevate CSS styling! Unleash the power of custom properties (variables). Enhance flexibility and design control. Level up your web styling now!","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.thecodecampus.de\/blog\/css-custom-properties-variables\/","og_locale":"en_US","og_type":"article","og_title":"CSS Custom Properties (Variables) - Web Development Blog","og_description":"Elevate CSS styling! Unleash the power of custom properties (variables). Enhance flexibility and design control. Level up your web styling now!","og_url":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/","og_site_name":"Web Development tips and tricks - theCodeCampus Blog","article_published_time":"2019-09-27T11:17:57+00:00","article_modified_time":"2025-04-22T08:27:11+00:00","og_image":[{"width":1405,"height":235,"url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png","type":"image\/png"}],"author":"theCodeCampus","twitter_card":"summary_large_image","twitter_misc":{"Written by":"theCodeCampus","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#article","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/"},"author":{"name":"theCodeCampus","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/276bbda2f8da73154f22fb652201cfbc"},"headline":"CSS Custom Properties (Variables)","datePublished":"2019-09-27T11:17:57+00:00","dateModified":"2025-04-22T08:27:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/"},"wordCount":587,"commentCount":0,"publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png","articleSection":["CSS","JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/","url":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/","name":"CSS Custom Properties (Variables) - Web Development Blog","isPartOf":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#primaryimage"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#primaryimage"},"thumbnailUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png","datePublished":"2019-09-27T11:17:57+00:00","dateModified":"2025-04-22T08:27:11+00:00","description":"Elevate CSS styling! Unleash the power of custom properties (variables). Enhance flexibility and design control. Level up your web styling now!","breadcrumb":{"@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#primaryimage","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2019\/09\/BrowserSupport.png","width":1405,"height":235},{"@type":"BreadcrumbList","@id":"https:\/\/www.thecodecampus.de\/blog\/css-custom-properties-variables\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thecodecampus.de\/blog\/"},{"@type":"ListItem","position":2,"name":"CSS Custom Properties (Variables)"}]},{"@type":"WebSite","@id":"https:\/\/www.thecodecampus.de\/blog\/#website","url":"https:\/\/www.thecodecampus.de\/blog\/","name":"Web Development tips and tricks - theCodeCampus Blog","description":"Tips, tricks, and experiences about developing web and mobile applications with Angular, TypeScript, and Testing.","publisher":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thecodecampus.de\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.thecodecampus.de\/blog\/#organization","name":"theCodeCampus","url":"https:\/\/www.thecodecampus.de\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch.jpg","width":156,"height":156,"caption":"theCodeCampus"},"image":{"@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.thecodecampus.de\/blog\/#\/schema\/person\/276bbda2f8da73154f22fb652201cfbc","name":"theCodeCampus","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","url":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","contentUrl":"https:\/\/www.thecodecampus.de\/blog\/wp-content\/uploads\/2024\/01\/TCC-Logo-Bildmarke-quadratisch-96x96.jpg","caption":"theCodeCampus"},"description":"Our knowledge is not simply gained through reading - it is trained, tested and constantly being expanded. Because first and foremost, we are all developers at W11K. The know-how that we acquire here as developers, consultants and information architects flows immediately into our training courses and articles for theCodeCampus.","sameAs":["https:\/\/www.linkedin.com\/showcase\/thecodecampus\/"],"url":"https:\/\/www.thecodecampus.de\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/2073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/comments?post=2073"}],"version-history":[{"count":43,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/2073\/revisions"}],"predecessor-version":[{"id":3433,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/posts\/2073\/revisions\/3433"}],"wp:attachment":[{"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/media?parent=2073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/categories?post=2073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thecodecampus.de\/blog\/wp-json\/wp\/v2\/tags?post=2073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}