1
I had my eye on the use of variables in CSS, like below, simple stuff, so far so good. Then I saw that I could incorporate 'functions', but I only saw the use of libs as lesscss and Sass.
You can define a function in the CSS - like the last 2 examples - without having to use installed libs?
It would make it easier to maintain the style sheet rather than having to define several classes to the elements, type <div class="azul borda maiusculo">Lorem ipsum</div>
.
:root {
--preto:#000;
--cinza:#999;
}
h1{color:var(--preto)}
h2{color:var(--cinza)}
<h1>Lorem ipsum</h1>
<h2>Lorem ipsum</h2>
.classH1(@color: red, @size: 16px){
font-size:@size;
border:@color 2px solid;
}
h1{
.classH1(green, 20px);
}
.classH1(){
font-size:10;
border:#000 2px solid;
}
h1{
.classH1();
}
I don’t know functions that do this, just with Less or Sass.. some CSS functions: W3schools CSS Functions
– Douglas Garrido
I recommend using LESS or SASS with Visual Studio Code editor, there is a plugin (easy Less) that when saving your LESS file already generates CSS in the same directory
– Lennon S. Bueno
@Well thanks, I’ll take a look to see.
– Papa Charlie
Dude I think this will interest you https://answall.com/questions/298995/o-que-significa-specified-no-root-do-css-do-bootstrap/298998#298998 da da para fazer muito coisa com variável
– hugocsl