File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 9595 "contributors" : [],
9696 "code" : " @mixin aspect-ratio($width, $height) {\n position: relative;\n width: 100%;\n padding-top: ($height / $width) * 100%;\n > * {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n }\n "
9797 },
98+ {
99+ "title" : " Dark Theme" ,
100+ "description" : " SCSS mixin to change styles for dark themes." ,
101+ "author" : " gihanrangana" ,
102+ "tags" : [
103+ " scss" ,
104+ " css" ,
105+ " mixin" ,
106+ " snippet" ,
107+ " dark-theme" ,
108+ " layout"
109+ ],
110+ "contributors" : [],
111+ "code" : " @mixin isDark($type: 'module') {\n $root: &;\n\n @if $type == 'module' {\n :global {\n @at-root body[theme='dark'] #{$root} {\n @content;\n }\n }\n } @else {\n &[theme='dark'] {\n @content;\n }\n }\n }\n\n // Usage:\n .container{\n\t background: #f0f0f0;\n\t @include isDark {\n\t\t background: #222;\n\t }\n }\n "
112+ },
98113 {
99114 "title" : " Flex Center" ,
100115 "description" : " A mixin to center content using flexbox." ,
You can’t perform that action at this time.
0 commit comments