Skip to content

Instantly share code, notes, and snippets.

@vviikk
Last active November 15, 2018 14:52
Show Gist options
  • Save vviikk/6edefdcc335794c78407ac979fa8db71 to your computer and use it in GitHub Desktop.
Save vviikk/6edefdcc335794c78407ac979fa8db71 to your computer and use it in GitHub Desktop.
custom properties ordering
:root {
/* CONSTANTS on top */
--COLOR-PRIMARY: palevioletred;
--COLOR-GRAY: silver;
/* Regular custom properties */
--heading-color: var(--COLOR-GRAY);
}
h1 {
/* Custom properties without calc */
--heading-color: var(--COLOR-PRIMARY); /* Value is overridden */
/* Custom properties with calc */
--heading-padding-bottom: calc(var(--padding) * 1em);
/* Properties that rely on other custom properties */
color: var(--heading-color);
/* Regular properties with CSS values */
text-decoration: underline;
}
button {
--button-scale-pc--hover: 25%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment