@gem-sdk/styles 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +1 -0
  2. package/dist/base.css +90 -0
  3. package/dist/base.min.css +1 -0
  4. package/dist/builder.css +102 -0
  5. package/dist/builder.min.css +1 -0
  6. package/dist/utility.css +6034 -0
  7. package/dist/utility.min.css +1 -0
  8. package/package.json +47 -0
  9. package/src/css/all.css +98 -0
  10. package/src/css/builds/base.css +93 -0
  11. package/src/css/builds/builder.css +96 -0
  12. package/src/css/builds/utility.css +6 -0
  13. package/src/css/helpers/_background.css +15 -0
  14. package/src/css/helpers/_layout.css +23 -0
  15. package/src/css/helpers/_position.css +40 -0
  16. package/src/css/helpers/_shadows.css +61 -0
  17. package/src/css/helpers/_spacing.css +21 -0
  18. package/src/css/helpers/_transform.css +36 -0
  19. package/src/css/helpers/_typography.css +54 -0
  20. package/src/css/medias.css +2 -0
  21. package/src/css/mixins.css +133 -0
  22. package/src/css/utilities/_background.css +22 -0
  23. package/src/css/utilities/_border.css +21 -0
  24. package/src/css/utilities/_flex.css +12 -0
  25. package/src/css/utilities/_grid.css +15 -0
  26. package/src/css/utilities/_interact.css +8 -0
  27. package/src/css/utilities/_layout.css +12 -0
  28. package/src/css/utilities/_misc.css +12 -0
  29. package/src/css/utilities/_overflow.css +3 -0
  30. package/src/css/utilities/_sizing.css +7 -0
  31. package/src/css/utilities/_spacing.css +13 -0
  32. package/src/css/utilities/_transform.css +4 -0
  33. package/src/css/utilities/_transition.css +6 -0
  34. package/src/css/utilities/_typography.css +33 -0
  35. package/src/css/utilities/all.css +113 -0
  36. package/src/css/variables.css +1 -0
  37. package/src/index.js +5 -0
  38. package/src/plugins/animation.js +109 -0
  39. package/src/plugins/components.js +59 -0
  40. package/src/plugins/contain-intrinsic-size.js +34 -0
  41. package/src/plugins/custom-variants.js +12 -0
  42. package/src/plugins/heading.js +32 -0
  43. package/src/plugins/size.js +20 -0
  44. package/src/plugins/typography.js +97 -0
  45. package/src/preset.js +130 -0
  46. package/src/properties.js +730 -0
  47. package/types/common.d.ts +11 -0
  48. package/types/globals.d.ts +2671 -0
  49. package/types/index.d.ts +9 -0
  50. package/types/types.d.ts +100 -0
@@ -0,0 +1,59 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
4
+ // Add your custom styles here
5
+ addUtilities({
6
+ '.display-inherit': {
7
+ display: 'inherit',
8
+ },
9
+ });
10
+ addComponents({
11
+ '.btn': {},
12
+ '.btn-small': {
13
+ padding: `${theme('padding.button-y-small')} ${theme('padding.button-x-small')}`,
14
+ borderRadius: theme('borderRadius.small'),
15
+ fontSize: theme('fontSize.button-small'),
16
+ },
17
+ '.btn-medium': {
18
+ padding: `${theme('padding.button-y-medium')} ${theme('padding.button-x-medium')}`,
19
+ borderRadius: theme('borderRadius.medium'),
20
+ fontSize: theme('fontSize.button-medium'),
21
+ },
22
+ '.btn-large': {
23
+ padding: `${theme('padding.button-y-large')} ${theme('padding.button-x-large')}`,
24
+ borderRadius: theme('borderRadius.large'),
25
+ fontSize: theme('fontSize.button-large'),
26
+ },
27
+ '.btn-primary': {
28
+ backgroundColor: theme('backgroundColor.button-primary'),
29
+ color: theme('textColor.button-primary'),
30
+ boxShadow: theme('boxShadow.button-primary'),
31
+ '&:hover': {
32
+ backgroundColor: theme('backgroundColor.button-primary-hover'),
33
+ color: theme('textColor.button-primary-hover'),
34
+ boxShadow: theme('boxShadow.button-primary-hover'),
35
+ },
36
+ },
37
+ '.btn-secondary': {
38
+ backgroundColor: theme('backgroundColor.button-secondary'),
39
+ color: theme('textColor.button-secondary'),
40
+ boxShadow: theme('boxShadow.button-secondary'),
41
+ '&:hover': {
42
+ backgroundColor: theme('backgroundColor.button-secondary-hover'),
43
+ color: theme('textColor.button-secondary-hover'),
44
+ boxShadow: theme('boxShadow.button-secondary-hover'),
45
+ },
46
+ },
47
+ '.btn-disabled': {
48
+ backgroundColor: theme('backgroundColor.button-disabled'),
49
+ color: theme('textColor.button-disabled'),
50
+ boxShadow: theme('boxShadow.button-disabled'),
51
+ cursor: 'default',
52
+ '&:hover': {
53
+ backgroundColor: theme('backgroundColor.button-disabled-hover'),
54
+ color: theme('textColor.button-disabled-hover'),
55
+ boxShadow: theme('boxShadow.button-disabled-hover'),
56
+ },
57
+ },
58
+ });
59
+ });
@@ -0,0 +1,34 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const containIntrinsicSizePlugin = plugin(
4
+ function ({ theme, matchUtilities, addUtilities }) {
5
+ addUtilities({
6
+ '.content-visibility-auto': {
7
+ 'content-visibility': 'auto',
8
+ },
9
+ '.content-visibility-hidden': {
10
+ 'content-visibility': 'hidden',
11
+ },
12
+ '.content-visibility-visible': {
13
+ 'content-visibility': 'visible',
14
+ },
15
+ });
16
+ matchUtilities(
17
+ {
18
+ 'contain-intrinsic-size': (value) => {
19
+ return {
20
+ containIntrinsicSize: value,
21
+ };
22
+ },
23
+ },
24
+ { values: theme('containIntrinsicSize') },
25
+ );
26
+ },
27
+ {
28
+ theme: {
29
+ containIntrinsicSize: {},
30
+ },
31
+ },
32
+ );
33
+
34
+ module.exports = containIntrinsicSizePlugin;
@@ -0,0 +1,12 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const customVariants = plugin(function ({ addVariant }) {
4
+ addVariant('supports-scrollbars', '@supports selector(::-webkit-scrollbar)');
5
+ addVariant('scrollbar', '&::-webkit-scrollbar');
6
+ addVariant('scrollbar-track', '&::-webkit-scrollbar-track');
7
+ addVariant('scrollbar-thumb', '&::-webkit-scrollbar-thumb');
8
+ addVariant('hocus', ['&:hover', '&:focus']);
9
+ addVariant('supports-grid', '@supports (display: grid)');
10
+ });
11
+
12
+ module.exports = customVariants;
@@ -0,0 +1,32 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const headingPlugin = plugin(
4
+ function ({ theme, matchUtilities }) {
5
+ matchUtilities(
6
+ {
7
+ heading: (value) => {
8
+ const [fontSize, lineHeight] = value.split(' ');
9
+ return {
10
+ fontSize: fontSize,
11
+ lineHeight: lineHeight,
12
+ };
13
+ },
14
+ },
15
+ { values: theme('heading') },
16
+ );
17
+ },
18
+ {
19
+ theme: {
20
+ heading: {
21
+ 1: '76px 120%',
22
+ 2: '57px 120%',
23
+ 3: '43px 150%',
24
+ 4: '32px 150%',
25
+ paragraph: '24px 150%',
26
+ small: '20px 150%',
27
+ },
28
+ },
29
+ },
30
+ );
31
+
32
+ module.exports = headingPlugin;
@@ -0,0 +1,20 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const size = plugin(function ({ addComponents }) {
4
+ addComponents({
5
+ '.g-s-small': {
6
+ padding: '0.5em 0.75em',
7
+ },
8
+ '.g-s-medium': {
9
+ padding: '0.75em 1em',
10
+ },
11
+ '.g-s-large': {
12
+ padding: '1em 1.25em',
13
+ },
14
+ '.g-s-none': {
15
+ padding: '0',
16
+ },
17
+ });
18
+ });
19
+
20
+ module.exports = size;
@@ -0,0 +1,97 @@
1
+ const plugin = require('tailwindcss/plugin');
2
+
3
+ const globalSortNameMapping = {
4
+ 'typography-heading-1-fontFamily': 'h1-ff',
5
+ 'typography-heading-1-fontSize': 'h1-size',
6
+ 'typography-heading-1-fontWeight': 'h1-weight',
7
+ 'typography-heading-1-lineHeight': 'h1-lh',
8
+ 'typography-heading-1-letterSpacing': 'h1-ls',
9
+ 'typography-heading-1-fontStyle': 'h1-fs',
10
+ 'typography-heading-2-fontFamily': 'h2-ff',
11
+ 'typography-heading-2-fontSize': 'h2-size',
12
+ 'typography-heading-2-fontWeight': 'h2-weight',
13
+ 'typography-heading-2-lineHeight': 'h2-lh',
14
+ 'typography-heading-2-letterSpacing': 'h2-ls',
15
+ 'typography-heading-2-fontStyle': 'h2-fs',
16
+ 'typography-heading-3-fontFamily': 'h3-ff',
17
+ 'typography-heading-3-fontSize': 'h3-size',
18
+ 'typography-heading-3-fontWeight': 'h3-weight',
19
+ 'typography-heading-3-lineHeight': 'h3-lh',
20
+ 'typography-heading-3-letterSpacing': 'h3-ls',
21
+ 'typography-heading-3-fontStyle': 'h3-fs',
22
+ 'typography-subheading-1-fontFamily': 'sh1-ff',
23
+ 'typography-subheading-1-fontSize': 'sh1-size',
24
+ 'typography-subheading-1-fontWeight': 'sh1-weight',
25
+ 'typography-subheading-1-lineHeight': 'sh1-lh',
26
+ 'typography-subheading-1-letterSpacing': 'sh1-ls',
27
+ 'typography-subheading-1-fontStyle': 'sh1-fs',
28
+ 'typography-subheading-2-fontFamily': 'sh2-ff',
29
+ 'typography-subheading-2-fontSize': 'sh2-size',
30
+ 'typography-subheading-2-fontWeight': 'sh2-weight',
31
+ 'typography-subheading-2-lineHeight': 'sh2-lh',
32
+ 'typography-subheading-2-letterSpacing': 'sh2-ls',
33
+ 'typography-subheading-2-fontStyle': 'sh2-fs',
34
+ 'typography-subheading-3-fontFamily': 'sh3-ff',
35
+ 'typography-subheading-3-fontSize': 'sh3-size',
36
+ 'typography-subheading-3-fontWeight': 'sh3-weight',
37
+ 'typography-subheading-3-lineHeight': 'sh3-lh',
38
+ 'typography-subheading-3-letterSpacing': 'sh3-ls',
39
+ 'typography-subheading-3-fontStyle': 'sh3-fs',
40
+ 'typography-paragraph-1-fontFamily': 'p1-ff',
41
+ 'typography-paragraph-1-fontSize': 'p1-size',
42
+ 'typography-paragraph-1-fontWeight': 'p1-weight',
43
+ 'typography-paragraph-1-lineHeight': 'p1-lh',
44
+ 'typography-paragraph-1-letterSpacing': 'p1-ls',
45
+ 'typography-paragraph-1-fontStyle': 'p1-fs',
46
+ 'typography-paragraph-2-fontFamily': 'p2-ff',
47
+ 'typography-paragraph-2-fontSize': 'p2-size',
48
+ 'typography-paragraph-2-fontWeight': 'p2-weight',
49
+ 'typography-paragraph-2-lineHeight': 'p2-lh',
50
+ 'typography-paragraph-2-letterSpacing': 'p2-ls',
51
+ 'typography-paragraph-2-fontStyle': 'p2-fs',
52
+ 'typography-paragraph-3-fontFamily': 'p3-ff',
53
+ 'typography-paragraph-3-fontSize': 'p3-size',
54
+ 'typography-paragraph-3-fontWeight': 'p3-weight',
55
+ 'typography-paragraph-3-lineHeight': 'p3-lh',
56
+ 'typography-paragraph-3-letterSpacing': 'p3-ls',
57
+ 'typography-paragraph-3-fontStyle': 'p3-fs',
58
+ };
59
+ function getShortName(name) {
60
+ return globalSortNameMapping[name] || name;
61
+ }
62
+
63
+ const typographyPlugin = plugin(
64
+ function ({ theme, addComponents }) {
65
+ const typos = theme('typography').reduce((acc, name) => {
66
+ return {
67
+ ...acc,
68
+ [`.g-${name}`]: {
69
+ fontSize: `var(--g-${getShortName(`typography-${name}-fontSize`)})`,
70
+ fontFamily: `var(--g-${getShortName(`typography-${name}-fontFamily`)})`,
71
+ fontWeight: `var(--g-${getShortName(`typography-${name}-fontWeight`)})`,
72
+ fontStyle: `var(--g-${getShortName(`typography-${name}-fontStyle`)})`,
73
+ lineHeight: `var(--g-${getShortName(`typography-${name}-lineHeight`)})`,
74
+ letterSpacing: `var(--g-${getShortName(`typography-${name}-letterSpacing`)})`,
75
+ },
76
+ };
77
+ }, {});
78
+ addComponents(typos);
79
+ },
80
+ {
81
+ theme: {
82
+ typography: [
83
+ 'heading-1',
84
+ 'heading-2',
85
+ 'heading-3',
86
+ 'subheading-1',
87
+ 'subheading-2',
88
+ 'subheading-3',
89
+ 'paragraph-1',
90
+ 'paragraph-2',
91
+ 'paragraph-3',
92
+ ],
93
+ },
94
+ },
95
+ );
96
+
97
+ module.exports = typographyPlugin;
package/src/preset.js ADDED
@@ -0,0 +1,130 @@
1
+ const defaultTheme = require('tailwindcss/defaultTheme');
2
+
3
+ /** @type {import('tailwindcss').Config} */
4
+ const preset = {
5
+ darkMode: 'media',
6
+ future: {
7
+ hoverOnlyWhenSupported: true,
8
+ },
9
+ theme: {
10
+ screens: {
11
+ tablet: { max: '1023px' },
12
+ mobile: { max: '767px' },
13
+ },
14
+ extend: {
15
+ animation: {
16
+ wiggle: 'wiggle 1s ease-in-out infinite',
17
+ grow: 'scale .3s linear',
18
+ 'progress-bar': 'progress 1s ease-in infinite',
19
+ shift: 'stockCounterShift 2s linear infinite',
20
+ },
21
+ aspectRatio: {
22
+ '4/3': '4 / 3',
23
+ },
24
+ backgroundColor: {
25
+ bold: 'var(--g-c-bg-1)',
26
+ normal: 'var(--g-c-bg-2)',
27
+ light: 'var(--g-c-bg-3)',
28
+ },
29
+ backgroundImage: {
30
+ 'stock-counter-animate':
31
+ 'linear-gradient( 45deg, transparent 25%, rgba(238, 238, 238, 0.5) 25%, rgba(238, 238, 238, 0.5) 30%, transparent 30%, transparent 35%, rgba(238, 238, 238, 0.5) 35%, rgba(238, 238, 238, 0.5) 70%, transparent 70% )',
32
+ },
33
+ boxShadow: {
34
+ 'card-1': '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)',
35
+ 'card-2': '0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)',
36
+ 'card-3': '0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23)',
37
+ 'card-4': '0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22)',
38
+ 'card-5': '0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22)',
39
+ glasses:
40
+ '0 0 0 3px rgb(255 255 255 / 85%), 0 0 3px 3px rgb(0 0 0 / 25%), inset 0 0 40px 2px rgb(0 0 0 / 25%)',
41
+ 'stock-counter': 'inset 0 0px 1px rgb(0 0 0 / 20%), inset 0 -2px 1px rgb(0 0 0 / 20%)',
42
+ },
43
+ fontSize: {
44
+ 0: '0px',
45
+ },
46
+ fontFamily: {
47
+ 'g-body': ['var(--g-font-body)', ...defaultTheme.fontFamily.serif],
48
+ 'g-heading': ['var(--g-font-heading)', ...defaultTheme.fontFamily.serif],
49
+ 'g-code': ['var(--g-font-code)', ...defaultTheme.fontFamily.serif],
50
+ },
51
+ keyframes: {
52
+ wiggle: {
53
+ '0%, 100%': { transform: 'rotate(-3deg)' },
54
+ '50%': { transform: 'rotate(3deg)' },
55
+ },
56
+ scale: {
57
+ '0%': { transform: 'scale(1.0)', '-webkit-transform': 'scale(1.0)' },
58
+ '100%': { transform: 'scale(1.1)', '-webkit-transform': 'scale(1.1)' },
59
+ },
60
+ flashing: {
61
+ '0%': { opacity: 0.2 },
62
+ '50%': { opacity: 0.4 },
63
+ '100%': { opacity: 1 },
64
+ },
65
+ progress: {
66
+ '0%': { width: '0%' },
67
+ '100%': { width: '99%' },
68
+ },
69
+ stockCounterShift: {
70
+ to: { backgroundPosition: '60px 100%' },
71
+ },
72
+ },
73
+ maxWidth: {
74
+ tablet: '1024px',
75
+ mobile: '768px',
76
+ },
77
+ textColor: {
78
+ heading: 'var(--g-c-text-1)',
79
+ body: 'var(--g-c-text-2)',
80
+ placeholder: 'var(--g-c-text-3)',
81
+ },
82
+ colors: {
83
+ g: {
84
+ brand: 'var(--g-c-brand)',
85
+ highlight: 'var(--g-c-highlight)',
86
+ 'text-1': 'var(--g-c-text-1)',
87
+ 'text-2': 'var(--g-c-text-2)',
88
+ 'text-3': 'var(--g-c-text-3)',
89
+ 'bg-1': 'var(--g-c-bg-1)',
90
+ 'bg-2': 'var(--g-c-bg-2)',
91
+ 'bg-3': 'var(--g-c-bg-3)',
92
+ 'line-1': 'var(--g-c-line-1)',
93
+ 'line-2': 'var(--g-c-line-2)',
94
+ 'line-3': 'var(--g-c-line-3)',
95
+ success: 'var(--g-c-success)',
96
+ error: 'var(--g-c-error)',
97
+ warning: 'var(--g-c-warning)',
98
+ info: 'var(--g-c-info)',
99
+ },
100
+ },
101
+ zIndex: {
102
+ 1: 1,
103
+ 2: 2,
104
+ 3: 3,
105
+ 4: 4,
106
+ 5: 5,
107
+ 6: 6,
108
+ 7: 7,
109
+ 8: 8,
110
+ 9: 9,
111
+ 60: 60,
112
+ 70: 70,
113
+ 80: 80,
114
+ 90: 90,
115
+ 100: 100,
116
+ },
117
+ },
118
+ },
119
+ plugins: [
120
+ require('@tailwindcss/line-clamp'),
121
+ require('./plugins/components'),
122
+ require('./plugins/typography'),
123
+ require('./plugins/contain-intrinsic-size'),
124
+ require('./plugins/size'),
125
+ require('./plugins/custom-variants'),
126
+ require('./plugins/animation'),
127
+ ],
128
+ };
129
+
130
+ module.exports = preset;