|
5 | 5 | { |
6 | 6 | "title": "Line Clamp Mixin", |
7 | 7 | "description": "A Sass mixin to clamp text to a specific number of lines.", |
8 | | - "code": "@mixin line-clamp($number) {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: $number;\n overflow: hidden;\n}", |
| 8 | + "code": [ |
| 9 | + "@mixin line-clamp($number) {", |
| 10 | + " display: -webkit-box;", |
| 11 | + " -webkit-box-orient: vertical;", |
| 12 | + " -webkit-line-clamp: $number;", |
| 13 | + " overflow: hidden;", |
| 14 | + "}" |
| 15 | + ], |
9 | 16 | "tags": ["sass", "mixin", "typography", "css"], |
10 | 17 | "author": "dostonnabotov" |
11 | 18 | }, |
12 | 19 | { |
13 | 20 | "title": "Text Overflow Ellipsis", |
14 | 21 | "description": "Ensures long text is truncated with an ellipsis.", |
15 | | - "code": "@mixin text-ellipsis {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}", |
| 22 | + "code": [ |
| 23 | + "@mixin text-ellipsis {", |
| 24 | + " overflow: hidden;", |
| 25 | + " white-space: nowrap;", |
| 26 | + " text-overflow: ellipsis;", |
| 27 | + "}" |
| 28 | + ], |
16 | 29 | "tags": ["sass", "mixin", "text", "css"], |
17 | 30 | "author": "dostonnabotov" |
18 | 31 | }, |
19 | 32 | { |
20 | 33 | "title": "Font Import Helper", |
21 | 34 | "description": "Simplifies importing custom fonts in Sass.", |
22 | | - "code": "@mixin import-font($family, $weight: 400, $style: normal) {\n @font-face {\n font-family: #{$family};\n font-weight: #{$weight};\n font-style: #{$style};\n src: url('/fonts/#{$family}-#{$weight}.woff2') format('woff2'),\n url('/fonts/#{$family}-#{$weight}.woff') format('woff');\n }\n}", |
| 35 | + "code": [ |
| 36 | + "@mixin import-font($family, $weight: 400, $style: normal) {", |
| 37 | + " @font-face {", |
| 38 | + " font-family: #{$family};", |
| 39 | + " font-weight: #{$weight};", |
| 40 | + " font-style: #{$style};", |
| 41 | + " src: url('/fonts/#{$family}-#{$weight}.woff2') format('woff2'),", |
| 42 | + " url('/fonts/#{$family}-#{$weight}.woff') format('woff');", |
| 43 | + " }", |
| 44 | + "}" |
| 45 | + ], |
23 | 46 | "tags": ["sass", "mixin", "fonts", "css"], |
24 | 47 | "author": "dostonnabotov" |
25 | 48 | }, |
26 | 49 | { |
27 | 50 | "title": "Text Gradient", |
28 | 51 | "description": "Adds a gradient color effect to text.", |
29 | | - "code": "@mixin text-gradient($from, $to) {\n background: linear-gradient(to right, $from, $to);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n}", |
| 52 | + "code": [ |
| 53 | + "@mixin text-gradient($from, $to) {", |
| 54 | + " background: linear-gradient(to right, $from, $to);", |
| 55 | + " -webkit-background-clip: text;", |
| 56 | + " -webkit-text-fill-color: transparent;", |
| 57 | + "}" |
| 58 | + ], |
30 | 59 | "tags": ["sass", "mixin", "gradient", "text", "css"], |
31 | 60 | "author": "dostonnabotov" |
32 | 61 | } |
|
38 | 67 | { |
39 | 68 | "title": "Grid Container", |
40 | 69 | "description": "Creates a responsive grid container with customizable column counts.", |
41 | | - "code": "@mixin grid-container($columns: 12, $gap: 1rem) {\n display: grid;\n grid-template-columns: repeat($columns, 1fr);\n gap: $gap;\n}", |
| 70 | + "code": [ |
| 71 | + "@mixin grid-container($columns: 12, $gap: 1rem) {", |
| 72 | + " display: grid;", |
| 73 | + " grid-template-columns: repeat($columns, 1fr);", |
| 74 | + " gap: $gap;", |
| 75 | + "}" |
| 76 | + ], |
42 | 77 | "tags": ["scss", "grid", "layout", "css"], |
43 | 78 | "author": "dostonnabotov" |
44 | 79 | }, |
45 | 80 | { |
46 | 81 | "title": "Flex Center", |
47 | 82 | "description": "A mixin to center content using flexbox.", |
48 | | - "code": "@mixin flex-center {\n display: flex;\n justify-content: center;\n align-items: center;\n}", |
| 83 | + "code": [ |
| 84 | + "@mixin flex-center {", |
| 85 | + " display: flex;", |
| 86 | + " justify-content: center;", |
| 87 | + " align-items: center;", |
| 88 | + "}" |
| 89 | + ], |
49 | 90 | "tags": ["scss", "flex", "center", "css"], |
50 | 91 | "author": "dostonnabotov" |
51 | 92 | }, |
52 | 93 | { |
53 | 94 | "title": "Aspect Ratio", |
54 | 95 | "description": "Ensures elements maintain a specific aspect ratio.", |
55 | | - "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}", |
| 96 | + "code": [ |
| 97 | + "@mixin aspect-ratio($width, $height) {", |
| 98 | + " position: relative;", |
| 99 | + " width: 100%;", |
| 100 | + " padding-top: ($height / $width) * 100%;", |
| 101 | + " > * {", |
| 102 | + " position: absolute;", |
| 103 | + " top: 0;", |
| 104 | + " left: 0;", |
| 105 | + " width: 100%;", |
| 106 | + " height: 100%;", |
| 107 | + " }", |
| 108 | + "}" |
| 109 | + ], |
56 | 110 | "tags": ["scss", "aspect-ratio", "layout", "css"], |
57 | 111 | "author": "dostonnabotov" |
58 | 112 | } |
|
64 | 118 | { |
65 | 119 | "title": "Fade In Animation", |
66 | 120 | "description": "Animates the fade-in effect.", |
67 | | - "code": "@keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@mixin fade-in($duration: 1s, $easing: ease-in-out) {\n animation: fade-in $duration $easing;\n}", |
| 121 | + "code": [ |
| 122 | + "@keyframes fade-in {", |
| 123 | + " from {", |
| 124 | + " opacity: 0;", |
| 125 | + " }", |
| 126 | + " to {", |
| 127 | + " opacity: 1;", |
| 128 | + " }", |
| 129 | + "}", |
| 130 | + "", |
| 131 | + "@mixin fade-in($duration: 1s, $easing: ease-in-out) {", |
| 132 | + " animation: fade-in $duration $easing;", |
| 133 | + "}" |
| 134 | + ], |
68 | 135 | "tags": ["scss", "animation", "fade", "css"], |
69 | 136 | "author": "dostonnabotov" |
70 | 137 | }, |
71 | 138 | { |
72 | 139 | "title": "Slide In From Left", |
73 | 140 | "description": "Animates content sliding in from the left.", |
74 | | - "code": "@keyframes slide-in-left {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@mixin slide-in-left($duration: 0.5s, $easing: ease-out) {\n animation: slide-in-left $duration $easing;\n}", |
| 141 | + "code": [ |
| 142 | + "@keyframes slide-in-left {", |
| 143 | + " from {", |
| 144 | + " transform: translateX(-100%);", |
| 145 | + " }", |
| 146 | + " to {", |
| 147 | + " transform: translateX(0);", |
| 148 | + " }", |
| 149 | + "}", |
| 150 | + "", |
| 151 | + "@mixin slide-in-left($duration: 0.5s, $easing: ease-out) {", |
| 152 | + " animation: slide-in-left $duration $easing;", |
| 153 | + "}" |
| 154 | + ], |
75 | 155 | "tags": ["scss", "animation", "slide", "css"], |
76 | 156 | "author": "dostonnabotov" |
77 | 157 | } |
|
83 | 163 | { |
84 | 164 | "title": "Responsive Breakpoints", |
85 | 165 | "description": "Generates media queries for responsive design.", |
86 | | - "code": "@mixin breakpoint($breakpoint) {\n @if $breakpoint == sm {\n @media (max-width: 576px) { @content; }\n } @else if $breakpoint == md {\n @media (max-width: 768px) { @content; }\n } @else if $breakpoint == lg {\n @media (max-width: 992px) { @content; }\n } @else if $breakpoint == xl {\n @media (max-width: 1200px) { @content; }\n }\n}", |
| 166 | + "code": [ |
| 167 | + "@mixin breakpoint($breakpoint) {", |
| 168 | + " @if $breakpoint == sm {", |
| 169 | + " @media (max-width: 576px) { @content; }", |
| 170 | + " } @else if $breakpoint == md {", |
| 171 | + " @media (max-width: 768px) { @content; }", |
| 172 | + " } @else if $breakpoint == lg {", |
| 173 | + " @media (max-width: 992px) { @content; }", |
| 174 | + " } @else if $breakpoint == xl {", |
| 175 | + " @media (max-width: 1200px) { @content; }", |
| 176 | + " }", |
| 177 | + "}" |
| 178 | + ], |
87 | 179 | "tags": ["scss", "responsive", "media-queries", "css"], |
88 | 180 | "author": "dostonnabotov" |
89 | 181 | }, |
90 | 182 | { |
91 | 183 | "title": "Clearfix", |
92 | 184 | "description": "Provides a clearfix utility for floating elements.", |
93 | | - "code": "@mixin clearfix {\n &::after {\n content: '';\n display: block;\n clear: both;\n }\n}", |
| 185 | + "code": [ |
| 186 | + "@mixin clearfix {", |
| 187 | + " &::after {", |
| 188 | + " content: '';", |
| 189 | + " display: block;", |
| 190 | + " clear: both;", |
| 191 | + " }", |
| 192 | + "}" |
| 193 | + ], |
94 | 194 | "tags": ["scss", "clearfix", "utility", "css"], |
95 | 195 | "author": "dostonnabotov" |
96 | 196 | } |
|
102 | 202 | { |
103 | 203 | "title": "Border Radius Helper", |
104 | 204 | "description": "Applies a customizable border-radius.", |
105 | | - "code": "@mixin border-radius($radius: 4px) {\n border-radius: $radius;\n}", |
| 205 | + "code": [ |
| 206 | + "@mixin border-radius($radius: 4px) {", |
| 207 | + " border-radius: $radius;", |
| 208 | + "}" |
| 209 | + ], |
106 | 210 | "tags": ["scss", "border", "radius", "css"], |
107 | 211 | "author": "dostonnabotov" |
108 | 212 | }, |
109 | 213 | { |
110 | 214 | "title": "Box Shadow Helper", |
111 | 215 | "description": "Generates a box shadow with customizable values.", |
112 | | - "code": "@mixin box-shadow($x: 0px, $y: 4px, $blur: 10px, $spread: 0px, $color: rgba(0, 0, 0, 0.1)) {\n box-shadow: $x $y $blur $spread $color;\n}", |
| 216 | + "code": [ |
| 217 | + "@mixin box-shadow($x: 0px, $y: 4px, $blur: 10px, $spread: 0px, $color: rgba(0, 0, 0, 0.1)) {", |
| 218 | + " box-shadow: $x $y $blur $spread $color;", |
| 219 | + "}" |
| 220 | + ], |
113 | 221 | "tags": ["scss", "box-shadow", "css", "effects"], |
114 | 222 | "author": "dostonnabotov" |
115 | 223 | } |
|
121 | 229 | { |
122 | 230 | "title": "Primary Button", |
123 | 231 | "description": "Generates a styled primary button.", |
124 | | - "code": "@mixin primary-button($bg: #007bff, $color: #fff) {\n background-color: $bg;\n color: $color;\n padding: 0.5rem 1rem;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n\n &:hover {\n background-color: darken($bg, 10%);\n }\n}", |
| 232 | + "code": [ |
| 233 | + "@mixin primary-button($bg: #007bff, $color: #fff) {", |
| 234 | + " background-color: $bg;", |
| 235 | + " color: $color;", |
| 236 | + " padding: 0.5rem 1rem;", |
| 237 | + " border: none;", |
| 238 | + " border-radius: 4px;", |
| 239 | + " cursor: pointer;", |
| 240 | + "", |
| 241 | + " &:hover {", |
| 242 | + " background-color: darken($bg, 10%);", |
| 243 | + " }", |
| 244 | + "}" |
| 245 | + ], |
125 | 246 | "tags": ["scss", "button", "primary", "css"], |
126 | 247 | "author": "dostonnabotov" |
127 | 248 | } |
|
0 commit comments