|
1 | | -import { createAtomicStyles, createAtomsFn } from '@vanilla-extract/sprinkles'; |
| 1 | +import { |
| 2 | + createAtomicStyles, |
| 3 | + createAtomsFn, |
| 4 | + createMapValueFn, |
| 5 | + createNormalizeValueFn, |
| 6 | +} from '@vanilla-extract/sprinkles'; |
2 | 7 |
|
3 | | -export const atoms = createAtomsFn( |
4 | | - createAtomicStyles({ |
5 | | - defaultCondition: 'mobile', |
6 | | - conditions: { |
7 | | - mobile: {}, |
8 | | - tablet: { |
9 | | - '@media': 'screen and (min-width: 768px)', |
10 | | - }, |
11 | | - desktop: { |
12 | | - '@media': 'screen and (min-width: 1024px)', |
13 | | - }, |
14 | | - darkDesktop: { |
15 | | - '@supports': 'not (display: grid)', |
16 | | - '@media': 'screen and (min-width: 1024px)', |
17 | | - selector: '[data-dark-mode] &', |
18 | | - }, |
| 8 | +const responsiveStyles = createAtomicStyles({ |
| 9 | + defaultCondition: 'mobile', |
| 10 | + conditions: { |
| 11 | + mobile: {}, |
| 12 | + tablet: { |
| 13 | + '@media': 'screen and (min-width: 768px)', |
19 | 14 | }, |
20 | | - properties: { |
21 | | - display: ['flex', 'none', 'block'], |
22 | | - paddingTop: { |
23 | | - small: '10px', |
24 | | - medium: '20px', |
25 | | - }, |
| 15 | + desktop: { |
| 16 | + '@media': 'screen and (min-width: 1024px)', |
26 | 17 | }, |
27 | | - }), |
| 18 | + darkDesktop: { |
| 19 | + '@supports': 'not (display: grid)', |
| 20 | + '@media': 'screen and (min-width: 1024px)', |
| 21 | + selector: '[data-dark-mode] &', |
| 22 | + }, |
| 23 | + }, |
| 24 | + responsiveArray: ['mobile', 'tablet', 'desktop'], |
| 25 | + properties: { |
| 26 | + display: ['flex', 'none', 'block'], |
| 27 | + paddingTop: { |
| 28 | + small: '10px', |
| 29 | + medium: '20px', |
| 30 | + }, |
| 31 | + }, |
| 32 | +}); |
| 33 | + |
| 34 | +export const atoms = createAtomsFn(responsiveStyles); |
| 35 | + |
| 36 | +export const mapResponsiveValue = createMapValueFn(responsiveStyles); |
| 37 | +export const normalizeResponsiveValue = createNormalizeValueFn( |
| 38 | + responsiveStyles, |
28 | 39 | ); |
0 commit comments