Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there a css property that would change nothing and where we can store information?

Tags:

css

Are there a css property that would change nothing?

I need this for testing purposes very often when writing scss just to see that I created a css selector correctly. For instance, I would be glad to have something like this foo: "helloworld1"; and later on I would be able to change the value of the foo and check the value in the developer tools to see that my selectors have indeed reached a correct element.

I thought about using the width: auto;, but sometimes the width is specified (e.g. width: 100px;).

like image 468
Sasuke Uchiha Avatar asked Oct 12 '25 06:10

Sasuke Uchiha


1 Answers

Define your own properties using custom properties (aka CSS variables)

Custom properties are solely for use by authors and users; CSS will never give them a meaning beyond what is presented here.

Also

Custom properties are ordinary properties, so they can be declared on any element, are resolved with the normal inheritance and cascade rules, can be made conditional with @media and other conditional rules, can be used in HTML’s style attribute, can be read or set using the CSSOM, etc.

like image 50
Temani Afif Avatar answered Oct 15 '25 02:10

Temani Afif



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!