Created
May 20, 2018 10:14
-
-
Save JawsomeJason/2dab3363d2077bbb33a26bd6c71bb64a to your computer and use it in GitHub Desktop.
Revisions
-
JawsomeJason created this gist
May 20, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ /* * Automatically applies spacing to all non-inline siblings * Disable in an element with `--SPACING-ENABLED: 0;`. Will automatically re-activate in children. Good for Grid Layout gap control. * Change direction with `--SPACING-HORIZONTAL: 1` */ * { margin: 0; /* change this to 1 if you need to space it from it's previous sibling. */ --SPACING-ENABLED: 0; --SPACING: 1em; /* change this to 0 to make an element spaced horizontally instead */ margin-top: calc(var(--SPACING) * var(--SPACING-ENABLED) * (1 - var(--SPACING-HORIZONTAL))); /* DO NOT CHANGE */ --SPACING-HORIZONTAL: 0; margin-left: calc(var(--SPACING) * var(--SPACING-ENABLED) * var(--SPACING-HORIZONTAL)); } /* All non-first sibling will be spaced apart */ body * + * { --SPACING-ENABLED: 1; }