Skip to content

Commit 6bb8645

Browse files
committed
chore: add example patterns
1 parent 529a27d commit 6bb8645

File tree

2 files changed

+59
-57
lines changed

2 files changed

+59
-57
lines changed

examples/custom-media-queries.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import { toCustomMediaQueriesString } from '../src'
1+
import { toCustomMediaQueriesArray, toCustomMediaQueriesString } from '../src'
22

3-
const cssVariables = toCustomMediaQueriesString({
3+
const customMediaQueries = {
44
phone: '(max-width: 414px)',
55
tablet: '(max-width: 768px)',
66
laptop: '(max-width: 1024px)',
77
desktop: '(max-width: 1440px)',
8-
})
8+
}
99

10-
console.log(cssVariables)
10+
const customMediaQueriesArray = toCustomMediaQueriesArray(customMediaQueries)
11+
const customMediaQueriesString = toCustomMediaQueriesString(customMediaQueries)
12+
13+
console.log(customMediaQueriesArray)
14+
console.log(customMediaQueriesString)

examples/custom-properties.ts

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,54 @@
1-
import { toCustomPropertiesString } from '../src'
1+
import { toCustomPropertiesArray, toCustomPropertiesString } from '../src'
22

3-
const cssVariables = toCustomPropertiesString(
4-
{
5-
success: {
6-
100: '#F4FDCD',
7-
200: '#E6FB9C',
8-
300: '#D1F46A',
9-
400: '#BAE944',
10-
500: '#9ADB0D',
11-
600: '#7EBC09',
12-
700: '#649D06',
13-
800: '#4C7F04',
14-
900: '#3B6902',
15-
},
16-
info: {
17-
100: '#CEFEF7',
18-
200: '#9DFEF6',
19-
300: '#6CFEFD',
20-
400: '#48F0FD',
21-
500: '#0CD8FC',
22-
600: '#08A9D8',
23-
700: '#067FB5',
24-
800: '#035B92',
25-
900: '#024278',
26-
},
27-
warning: {
28-
100: '#FEF6D9',
29-
200: '#FEEAB3',
30-
300: '#FEDB8C',
31-
400: '#FDCC70',
32-
500: '#FCB441',
33-
600: '#D8902F',
34-
700: '#B57020',
35-
800: '#925314',
36-
900: '#783E0C',
37-
},
38-
danger: {
39-
100: '#FFE6D6',
40-
200: '#FFC6AD',
41-
300: '#FFA083',
42-
400: '#FF7C65',
43-
500: '#FF4032',
44-
600: '#DB2427',
45-
700: '#B71928',
46-
800: '#930F27',
47-
900: '#7A0927',
48-
},
3+
const customProperties = {
4+
success: {
5+
100: '#F4FDCD',
6+
200: '#E6FB9C',
7+
300: '#D1F46A',
8+
400: '#BAE944',
9+
500: '#9ADB0D',
10+
600: '#7EBC09',
11+
700: '#649D06',
12+
800: '#4C7F04',
13+
900: '#3B6902',
4914
},
50-
{
51-
prefix: 'color',
52-
withRGB: true,
53-
}
54-
)
15+
info: {
16+
100: '#CEFEF7',
17+
200: '#9DFEF6',
18+
300: '#6CFEFD',
19+
400: '#48F0FD',
20+
500: '#0CD8FC',
21+
600: '#08A9D8',
22+
700: '#067FB5',
23+
800: '#035B92',
24+
900: '#024278',
25+
},
26+
warning: {
27+
100: '#FEF6D9',
28+
200: '#FEEAB3',
29+
300: '#FEDB8C',
30+
400: '#FDCC70',
31+
500: '#FCB441',
32+
600: '#D8902F',
33+
700: '#B57020',
34+
800: '#925314',
35+
900: '#783E0C',
36+
},
37+
danger: {
38+
100: '#FFE6D6',
39+
200: '#FFC6AD',
40+
300: '#FFA083',
41+
400: '#FF7C65',
42+
500: '#FF4032',
43+
600: '#DB2427',
44+
700: '#B71928',
45+
800: '#930F27',
46+
900: '#7A0927',
47+
},
48+
}
49+
50+
const customPropertiesArray = toCustomPropertiesArray(customProperties)
51+
const customPropertiesString = toCustomPropertiesString(customProperties)
5552

56-
console.log(cssVariables)
53+
console.log(customPropertiesArray)
54+
console.log(customPropertiesString)

0 commit comments

Comments
 (0)