I do not even know how to ask. Suppose there is a large CSS file with many identical styles (for example, color:#000 ). How can I prescribe this style only once and so that it is transmitted to all lines where there is for example color: какое-то слово or something like that. I saw on CodePen that they are doing this, but at least I don’t remember to kill and I don’t even know what words to look for

2 answers 2

This is done through CSS variables:

 html { --color: red; } span { color: var(--color); } 
 <span>Цвет</span> 

But I do not advise you to use them, since the method is not cross-browser and is not supported in older versions of browsers at all.

  • one
    and what is var? - user33274
  • Instead of --color you can write anything? - steep
  • @ MaksimLensky, var is a variable - Yuri
  • @steep, put before the text -- need - Yuri
  • @Yuri yes, I understand that it is variable, but does it apply to css? - user33274

Use preprocessors like sass / scss or stylus . They support variables, functions, nesting and many more other buns)