|
| 1 | +export const FlexGridScss = ` |
| 2 | +@use '@carbon/styles/scss/colors' as *; |
| 3 | +
|
| 4 | +// base of project work area |
| 5 | +#root > #templates > div:first-child { |
| 6 | + inline-size: 100%; |
| 7 | +} |
| 8 | +
|
| 9 | +// grid styles |
| 10 | +.cds--grid .outside { |
| 11 | + block-size: 100%; |
| 12 | + min-block-size: 80px; |
| 13 | +} |
| 14 | +
|
| 15 | +.cds--grid .inside { |
| 16 | + block-size: 100%; |
| 17 | + min-block-size: 80px; |
| 18 | +} |
| 19 | +
|
| 20 | +// hack to enable zoom feature to trigger |
| 21 | +.cds--grid--full-width { |
| 22 | + max-inline-size: 100%; |
| 23 | +} |
| 24 | +
|
| 25 | +.default .cds--col code { |
| 26 | + display: flex; |
| 27 | + justify-content: center; |
| 28 | +} |
| 29 | +
|
| 30 | +// template hard-coded styles |
| 31 | +#templates .inside { |
| 32 | + background-color: $blue-10; |
| 33 | +} |
| 34 | +
|
| 35 | +#templates .cds--grid [class*='col'] { |
| 36 | + background-color: $blue-20; |
| 37 | + outline: 1px dashed $blue-40; |
| 38 | +} |
| 39 | +
|
| 40 | +#templates .cds--grid--condensed, |
| 41 | +#templates .cds--row--condensed { |
| 42 | + background-color: $warm-gray-100; |
| 43 | + color: $gray-10; |
| 44 | +} |
| 45 | +
|
| 46 | +#templates .cds--grid--condensed [class*='col'], |
| 47 | +#templates .cds--row--condensed [class*='col'] { |
| 48 | + background: none; |
| 49 | + outline: none; |
| 50 | +} |
| 51 | +
|
| 52 | +#templates .cds--grid--condensed .outside, |
| 53 | +#templates .cds--row--condensed .outside { |
| 54 | + background-color: $gray-80; |
| 55 | + outline: none; |
| 56 | +} |
| 57 | +
|
| 58 | +#templates .cds--grid--condensed .inside, |
| 59 | +#templates .cds--row--condensed .inside { |
| 60 | + background: none; |
| 61 | +} |
| 62 | +
|
| 63 | +#templates .cds--grid--narrow .inside, |
| 64 | +#templates .cds--row--narrow .inside { |
| 65 | + background-color: $teal-10; |
| 66 | +} |
| 67 | +
|
| 68 | +#templates .cds--grid--narrow [class*='col'], |
| 69 | +#templates .cds--row--narrow [class*='col'] { |
| 70 | + background-color: $teal-20; |
| 71 | + outline: 1px dashed $teal-40; |
| 72 | +} |
| 73 | +
|
| 74 | +// css grid |
| 75 | +#templates > .cds--css-grid { |
| 76 | + border: 1px dashed black; |
| 77 | +} |
| 78 | +
|
| 79 | +#templates .cds--css-grid .cds--subgrid [class*='col'] { |
| 80 | + background-color: rgba(#ffe056, 0.25); |
| 81 | + outline: 1px solid #ffe056; |
| 82 | +} |
| 83 | +
|
| 84 | +#templates .cds--css-grid [class*='col'] { |
| 85 | + background-color: #edf4ff; |
| 86 | + min-block-size: 80px; |
| 87 | + outline: 1px solid #a6c8ff; |
| 88 | +} |
| 89 | +`; |
| 90 | + |
| 91 | +export const GridScss = ` |
| 92 | +@use '@carbon/styles/scss/colors' as *; |
| 93 | +@use '@carbon/styles/scss/type' as *; |
| 94 | +
|
| 95 | +.sb-css-grid-container { |
| 96 | + // Gutter modes |
| 97 | + .cds--css-grid { |
| 98 | + background-color: $blue-20; |
| 99 | + outline: 1px dashed $blue-40; |
| 100 | + } |
| 101 | +
|
| 102 | + .cds--css-grid p { |
| 103 | + @include type-style('code-02'); |
| 104 | + } |
| 105 | +
|
| 106 | + .cds--css-grid p:first-of-type { |
| 107 | + margin-block-start: 0; |
| 108 | + } |
| 109 | +
|
| 110 | + // Narrow |
| 111 | + .cds--css-grid.cds--css-grid--narrow { |
| 112 | + background-color: #d6f9f9; |
| 113 | + outline: 1px dashed $green-40; |
| 114 | + } |
| 115 | +
|
| 116 | + // Condensed |
| 117 | + .cds--css-grid.cds--css-grid--condensed { |
| 118 | + background-color: $purple-10; |
| 119 | + outline: 1px dashed $purple-40; |
| 120 | + } |
| 121 | +
|
| 122 | + .cds--subgrid { |
| 123 | + position: relative; |
| 124 | + background: #eef4ff; |
| 125 | + outline: 1px solid black; |
| 126 | + padding-block: 2rem; |
| 127 | + } |
| 128 | +
|
| 129 | + .cds--css-grid, |
| 130 | + .cds--subgrid--wide { |
| 131 | + --grid-mode-color: #97c1ff; |
| 132 | + } |
| 133 | +
|
| 134 | + .cds--css-grid--narrow, |
| 135 | + .cds--subgrid--narrow { |
| 136 | + --grid-mode-color: #20d5d2; |
| 137 | +
|
| 138 | + background: $green-10; |
| 139 | + } |
| 140 | +
|
| 141 | + .cds--css-grid--condensed, |
| 142 | + .cds--subgrid--condensed { |
| 143 | + --grid-mode-color: #bb8eff; |
| 144 | +
|
| 145 | + background: $purple-10; |
| 146 | + } |
| 147 | +
|
| 148 | + .cds--subgrid--narrow { |
| 149 | + background: #d6f9f9; |
| 150 | + } |
| 151 | +
|
| 152 | + .cds--subgrid--condensed { |
| 153 | + background: #f7f2ff; |
| 154 | + } |
| 155 | +
|
| 156 | + .cds--subgrid::before { |
| 157 | + @include type-style('code-01'); |
| 158 | +
|
| 159 | + position: absolute; |
| 160 | + display: block; |
| 161 | + padding: 0.125rem 0.25rem; |
| 162 | + background: var(--grid-mode-color, #97c1ff); |
| 163 | + color: $black; |
| 164 | + content: 'subgrid'; |
| 165 | + inset-block-start: 0; |
| 166 | + inset-inline-start: 0; |
| 167 | + } |
| 168 | +
|
| 169 | + // Column |
| 170 | + .cds--css-grid-column { |
| 171 | + --border-color: #97c1ff; |
| 172 | +
|
| 173 | + background: $white; |
| 174 | + box-shadow: 0 0 0 1px var(--border-color); |
| 175 | +
|
| 176 | + min-block-size: 80px; |
| 177 | + } |
| 178 | +
|
| 179 | + .cds--css-grid--narrow .cds--css-grid-column, |
| 180 | + .cds--subgrid--narrow .cds--css-grid-column { |
| 181 | + --border-color: #20d5d2; |
| 182 | + } |
| 183 | +
|
| 184 | + .cds--css-grid--condensed .cds--css-grid-column, |
| 185 | + .cds--subgrid--condensed .cds--css-grid-column { |
| 186 | + --border-color: #bb8eff; |
| 187 | + } |
| 188 | +} |
| 189 | +`; |
| 190 | + |
| 191 | +export const LayerScss = ` |
| 192 | +@use '@carbon/styles/scss/theme'; |
| 193 | +
|
| 194 | +.example-layer-test-component { |
| 195 | + padding: 1rem; |
| 196 | + background: theme.$layer; |
| 197 | + color: theme.$text-primary; |
| 198 | +} |
| 199 | +
|
| 200 | +.example-layer-test-component-no-background { |
| 201 | + padding: 1rem; |
| 202 | + color: theme.$text-primary; |
| 203 | +} |
| 204 | +`; |
| 205 | + |
| 206 | +export const ThemeScss = ` |
| 207 | +@use '@carbon/styles/scss/themes'; |
| 208 | +@use '@carbon/styles/scss/theme'; |
| 209 | +
|
| 210 | +.theme-section { |
| 211 | + padding: 1rem; |
| 212 | + background: theme.$background; |
| 213 | + color: theme.$text-primary; |
| 214 | +} |
| 215 | +
|
| 216 | +.theme-layer-example { |
| 217 | + padding: 1rem; |
| 218 | + background: theme.$background; |
| 219 | + color: theme.$text-primary; |
| 220 | +} |
| 221 | +
|
| 222 | +.theme-layer-header { |
| 223 | + margin-block-end: 1rem; |
| 224 | +} |
| 225 | +
|
| 226 | +.theme-with-layer { |
| 227 | + padding: 1rem; |
| 228 | + background: theme.$layer; |
| 229 | + color: theme.$text-primary; |
| 230 | +} |
| 231 | +
|
| 232 | +.carbon-storybook-template--annotation--background { |
| 233 | + margin: 0 !important; /* stylelint-disable-line declaration-no-important */ |
| 234 | + min-block-size: 0 !important; /* stylelint-disable-line declaration-no-important */ |
| 235 | +} |
| 236 | +`; |
0 commit comments