Cyrus Bitangcol
Share This
Scroll Down
Categories
//CSS VARIABLES LANDING IN CHROME 49

CSS VARIABLES LANDING IN CHROME 49

CSS VARIABLES LANDING IN CHROME 49

You read it right! Now chrome 49 is getting full support for CSS variables to help you clean up your codes. This is not actually a news as w3c started working on CSS variables long time ago as part of unofficial CSS4.

These days, most developer code in Sass or Less which support creating variables. Good thing about using this is it can also be used within the media queries and if you modify a CSS variable in Javascript, it will recompute all of its functions without any issues

Declaring a Variable:

:html {
–main-color: #00ccff;
}

Using the variables:

#text h1 {
color: var(–main-color);
}

Developers can now use var() function to set a custom property name and its value to reuse their CSS. Only chrome 49, firefox 43+ and iOS 9.3 support the standard.

  • 0 Comment
Get in Touch
Close