ELI5: What is a CSS and what does it do when you customize it on your Wordpress site?
ELI5: How does CSS work?
html - Why do I need to use CSS when I can just use Javascript? - Stack Overflow
What is the CSS profile?
Videos
Factsheet
I’m a programmer by trade. I use CSS just about every day, but I’d be lying if I said I understood how it works under the hood. What exactly does CSS do behind the scenes when I pass the parameters? How does browser support play a role in all of it?
Styles are preprocessed and compiled to separate CSS assets, this would simply not be possible if they had dynamic parts.
In general CSS should concern itself with styling/layout and JS with state/logic. This makes it easier to know where what should go/can be found and easier to read. Also there are many things you just cannot do in JS at all and vice versa, the languages are designed for their specific roles.
CSS does not seem very useful if I cannot pass variables to it. Is this a bottleneck of Svelte? Am I missing something obvious?
In general you just don't have to. You set state, e.g. classes and attributes, and all the necessary styling or layout changes that state should entail happen in CSS. If you want to do everything "in code' you are probably thinking about problems the wrong way; Svelte has some limitations here but they really don't matter much if styling is approach the right way.
When it really is necessary, you also can pass variables by using the style attribute, setting custom properties which can be accessed in CSS. This can, for example, be necessary to move elements like popups around, when layout cannot be fully calculated in CSS.
You can define variables in your CSS :root:
:root {
--custom_color: #0085ff;
}
and then access them with the var() function:
a.link {
var(--custom_color);
}
For more information, you can read this about CSS variable usage on W3Schools.
You can also edit the variables in your CSS :root with Javascript like this:
document.documentElement.style.setProperty('--var', 'value');
document.documentElement.style.setProperty('--custom_color', '#ff8500');
ok so call me an idiot but I literally just heard about this thing recently and it seems really important. Can someone give me a brief rundown of it, and what is the deadline for most colleges? What happens if I don't submit it?
I would say it is a domain-specific declarative language.
Syntactically, CSS is a mix of two languages: the language of selectors, which is a pattern-matching one, like regexps or xpath, and the language of properties, which can be classified as "procedural-declarative", because properties are essentially assignment operators. At a subjective level, css clearly qualifies as ugly mess, like pretty much every other fruit of collective efforts on the field of language design ("a camel is a horse designed by committee").