+ 2

What is root in css and some strange these [something] ? Please explain it?

:root { --border-color: #A2A9B1; --title-font: 'Linux Libertine','Georgia','Times',serif; --content-font: sans-serif; } [theme="light"] { --main-bg-color: #f6f6f6; --main-text-color: #333; --link-filter-brightness: 50%; } [theme="dark"] { --main-bg-color: #333; --main-text-color: #f6f6f6; --link-filter-brightness: 100%; }

24th Feb 2020, 8:07 AM
Avinash
Avinash - avatar
8 Réponses
+ 4
did a bit of reseach, its a custom properties. it's used kinda like a variable so lets say have a h1 and want to use it h1{ font-family: var(--title-font); } it'll be same as h1{ font-family: 'Linux Libertine','Georgia','Times',serif; }
24th Feb 2020, 8:44 AM
Taste
Taste - avatar
+ 2
Please explain it I couldn't understand... cz, title-font isn't a property..
24th Feb 2020, 8:21 AM
Avinash
Avinash - avatar
+ 2
tbh i'm not sure, my best guess its a kind of css prepocessor.
24th Feb 2020, 8:29 AM
Taste
Taste - avatar
+ 2
Ok
24th Feb 2020, 8:31 AM
Avinash
Avinash - avatar
+ 2
Hey Mirielle , what is the meaning of your last line of statement.
24th Feb 2020, 8:48 AM
Avinash
Avinash - avatar
+ 2
Is the a different way to write css. Generally We write h2{ Background-color:red; } can this be written in differently As??
25th Feb 2020, 7:43 PM
Dushyant Kumar Tyagi
Dushyant Kumar Tyagi - avatar
+ 1
it represent the root of the document, usually its the <html>
24th Feb 2020, 8:20 AM
Taste
Taste - avatar