|
1 | 1 | // Border utilities |
2 | 2 | // stylelint-disable block-opening-brace-space-before, primer/selector-no-utility, comment-empty-line-before |
3 | 3 |
|
4 | | -/* Add a gray border */ |
5 | | -.border { border: $border !important; } |
6 | | -/* Add a gray border to the top */ |
7 | | -.border-top { border-top: $border !important; } |
8 | | -/* Add a gray border to the right */ |
9 | | -.border-right { border-right: $border !important; } |
10 | | -/* Add a gray border to the bottom */ |
11 | | -.border-bottom { border-bottom: $border !important; } |
12 | | -/* Add a gray border to the left */ |
13 | | -.border-left { border-left: $border !important; } |
| 4 | +/* Add a gray border on all sides */ |
| 5 | +.border { border: $border !important; } |
| 6 | + |
14 | 7 | /* Add a gray border to the left and right */ |
15 | 8 | .border-y { |
16 | 9 | border-top: $border !important; |
17 | 10 | border-bottom: $border !important; |
18 | 11 | } |
19 | 12 |
|
| 13 | +/* Remove borders from all sides */ |
| 14 | +.border-0 { border: 0 !important; } |
| 15 | + |
20 | 16 | .border-dashed { border-style: dashed !important; } |
21 | 17 |
|
22 | 18 | /* Use with .border to turn the border blue */ |
23 | | -.border-blue { border-color: $border-blue !important; } |
| 19 | +.border-blue { border-color: $border-blue !important; } |
24 | 20 | /* Use with .border to turn the border blue-light */ |
25 | 21 | .border-blue-light { border-color: $border-blue-light !important; } |
26 | 22 | /* Use with .border to turn the border green */ |
27 | | -.border-green { border-color: $border-green !important; } |
| 23 | +.border-green { border-color: $border-green !important; } |
28 | 24 | /* Use with .border to turn the border green light */ |
29 | 25 | .border-green-light { border-color: $border-green-light !important; } |
30 | 26 | /* Use with .border to turn the border red */ |
31 | | -.border-red { border-color: $border-red !important; } |
| 27 | +.border-red { border-color: $border-red !important; } |
32 | 28 | /* Use with .border to turn the border red-light */ |
33 | 29 | .border-red-light { border-color: $border-red-light !important; } |
34 | 30 | /* Use with .border to turn the border purple */ |
35 | | -.border-purple { border-color: $border-purple !important; } |
| 31 | +.border-purple { border-color: $border-purple !important; } |
36 | 32 | /* Use with .border to turn the border yellow */ |
37 | | -.border-yellow { border-color: $border-yellow !important; } |
| 33 | +.border-yellow { border-color: $border-yellow !important; } |
38 | 34 | /* Use with .border to turn the border gray-light */ |
39 | | -.border-gray-light { border-color: $border-gray-light !important; } |
| 35 | +.border-gray-light { border-color: $border-gray-light !important; } |
40 | 36 | /* Use with .border to turn the border gray-dark */ |
41 | | -.border-gray-dark { border-color: $border-gray-dark !important; } |
| 37 | +.border-gray-dark { border-color: $border-gray-dark !important; } |
42 | 38 | /* Use with .border to turn the border rgba black 0.15 */ |
43 | | -.border-black-fade { border-color: $border-black-fade !important; } |
| 39 | +.border-black-fade { border-color: $border-black-fade !important; } |
| 40 | + |
| 41 | +$edges: ( |
| 42 | + top: (top-left, top-right), |
| 43 | + right: (top-right, bottom-right), |
| 44 | + bottom: (bottom-right, bottom-left), |
| 45 | + left: (bottom-left, top-left) |
| 46 | +); |
| 47 | + |
| 48 | +@each $breakpoint, $variant in $responsive-variants { |
| 49 | + @include breakpoint($breakpoint) { |
| 50 | + /* Add a gray border */ |
| 51 | + /* Add a gray border to the top */ |
| 52 | + .border#{$variant}-top { border-top: $border !important; } |
| 53 | + /* Add a gray border to the right */ |
| 54 | + .border#{$variant}-right { border-right: $border !important; } |
| 55 | + /* Add a gray border to the bottom */ |
| 56 | + .border#{$variant}-bottom { border-bottom: $border !important; } |
| 57 | + /* Add a gray border to the left */ |
| 58 | + .border#{$variant}-left { border-left: $border !important; } |
| 59 | + |
| 60 | + /* Remove the top border */ |
| 61 | + .border#{$variant}-top-0 { border-top: 0 !important; } |
| 62 | + /* Remove the right border */ |
| 63 | + .border#{$variant}-right-0 { border-right: 0 !important; } |
| 64 | + /* Remove the bottom border */ |
| 65 | + .border#{$variant}-bottom-0 { border-bottom: 0 !important; } |
| 66 | + /* Remove the left border */ |
| 67 | + .border#{$variant}-left-0 { border-left: 0 !important; } |
44 | 68 |
|
45 | | -// Without borders |
46 | | -/* Remove all borders */ |
47 | | -.border-0 { border: 0 !important; } |
48 | | -/* Remove the top border */ |
49 | | -.border-top-0 { border-top: 0 !important; } |
50 | | -/* Remove the right border */ |
51 | | -.border-right-0 { border-right: 0 !important; } |
52 | | -/* Remove the bottom border */ |
53 | | -.border-bottom-0 { border-bottom: 0 !important; } |
54 | | -/* Remove the left border */ |
55 | | -.border-left-0 { border-left: 0 !important; } |
| 69 | + // Rounded corners |
| 70 | + /* Remove the border-radius */ |
| 71 | + .rounded#{$variant}-0 { border-radius: 0 !important; } |
| 72 | + /* Add a border-radius to all corners */ |
| 73 | + .rounded#{$variant}-1 { border-radius: $border-radius !important; } |
| 74 | + /* Add a 2x border-radius to all corners */ |
| 75 | + .rounded#{$variant}-2 { border-radius: $border-radius * 2 !important; } |
| 76 | + |
| 77 | + @each $edge, $corners in $edges { |
| 78 | + .rounded#{$variant}-#{$edge}-0 { |
| 79 | + @each $corner in $corners { |
| 80 | + border-#{$corner}-radius: 0; |
| 81 | + } |
| 82 | + } |
| 83 | + |
| 84 | + .rounded#{$variant}-#{$edge}-1 { |
| 85 | + @each $corner in $corners { |
| 86 | + border-#{$corner}-radius: $border-radius; |
| 87 | + } |
| 88 | + } |
| 89 | + |
| 90 | + .rounded#{$variant}-#{$edge}-2 { |
| 91 | + @each $corner in $corners { |
| 92 | + border-#{$corner}-radius: $border-radius * 2; |
| 93 | + } |
| 94 | + } |
| 95 | + } |
| 96 | + } |
| 97 | +} |
56 | 98 |
|
57 | | -// Rounded corners |
58 | | -/* Remove the border-radius */ |
59 | | -.rounded-0 { border-radius: 0 !important; } |
60 | | -/* Add a border-radius to all corners */ |
61 | | -.rounded-1 { border-radius: $border-radius !important; } |
62 | | -/* Add a 2x border-radius to all corners */ |
63 | | -.rounded-2 { border-radius: $border-radius * 2 !important; } |
64 | 99 | /* Add a 50% border-radius to make something into a circle */ |
65 | 100 | .circle { border-radius: 50% !important; } |
0 commit comments