@mastors/core 1.1.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 (96) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +940 -0
  3. package/api/_index.scss +5 -0
  4. package/dist/mastors-core.css +7419 -0
  5. package/dist/mastors-core.css.map +1 -0
  6. package/package.json +73 -0
  7. package/postinstall.js +41 -0
  8. package/scripts/generate-tokens.js +259 -0
  9. package/scss/abstracts/_index.scss +6 -0
  10. package/scss/abstracts/_maps.scss +9 -0
  11. package/scss/abstracts/_placeholders.scss +7 -0
  12. package/scss/accessibility/_focus.scss +21 -0
  13. package/scss/accessibility/_index.scss +7 -0
  14. package/scss/accessibility/_motion.scss +14 -0
  15. package/scss/accessibility/_print.scss +52 -0
  16. package/scss/accessibility/_screen-reader.scss +31 -0
  17. package/scss/api/_index.scss +14 -0
  18. package/scss/base/_box-sizing.scss +6 -0
  19. package/scss/base/_index.scss +7 -0
  20. package/scss/base/_reset.scss +59 -0
  21. package/scss/base/_root.scss +43 -0
  22. package/scss/base/_typography-base.scss +40 -0
  23. package/scss/config/_flags.scss +13 -0
  24. package/scss/config/_index.scss +12 -0
  25. package/scss/config/_settings.scss +18 -0
  26. package/scss/functions/_color.scss +66 -0
  27. package/scss/functions/_em.scss +28 -0
  28. package/scss/functions/_index.scss +15 -0
  29. package/scss/functions/_map-helpers.scss +29 -0
  30. package/scss/functions/_math.scss +40 -0
  31. package/scss/functions/_rem.scss +27 -0
  32. package/scss/functions/_string.scss +57 -0
  33. package/scss/functions/_vars.scss +49 -0
  34. package/scss/generators/_class-generator.scss +83 -0
  35. package/scss/generators/_custom-property-generator.scss +29 -0
  36. package/scss/generators/_index.scss +6 -0
  37. package/scss/generators/_responsive-generator.scss +28 -0
  38. package/scss/helpers/_clearfix.scss +9 -0
  39. package/scss/helpers/_index.scss +7 -0
  40. package/scss/helpers/_ratio.scss +22 -0
  41. package/scss/helpers/_truncate.scss +25 -0
  42. package/scss/helpers/_visually-hidden.scss +39 -0
  43. package/scss/index.scss +41 -0
  44. package/scss/mixins/_breakpoint.scss +33 -0
  45. package/scss/mixins/_container.scss +20 -0
  46. package/scss/mixins/_elevation.scss +12 -0
  47. package/scss/mixins/_index.scss +9 -0
  48. package/scss/mixins/_pseudo.scss +13 -0
  49. package/scss/mixins/_theme.scss +31 -0
  50. package/scss/mixins/_transition.scss +20 -0
  51. package/scss/responsive/_container-queries.scss +31 -0
  52. package/scss/responsive/_engine.scss +65 -0
  53. package/scss/responsive/_fluid-type.scss +40 -0
  54. package/scss/responsive/_index.scss +6 -0
  55. package/scss/semantic/_colors.scss +29 -0
  56. package/scss/semantic/_index.scss +6 -0
  57. package/scss/semantic/_spacing.scss +13 -0
  58. package/scss/semantic/_typography.scss +13 -0
  59. package/scss/themes/_base-theme.scss +28 -0
  60. package/scss/themes/_dark.scss +59 -0
  61. package/scss/themes/_index.scss +6 -0
  62. package/scss/themes/_light.scss +31 -0
  63. package/scss/tokens/_color.scss +100 -0
  64. package/scss/tokens/_index.scss +12 -0
  65. package/scss/tokens/_opacity.scss +28 -0
  66. package/scss/tokens/_radii.scss +21 -0
  67. package/scss/tokens/_shadows.scss +20 -0
  68. package/scss/tokens/_sizing.scss +47 -0
  69. package/scss/tokens/_spacing.scss +48 -0
  70. package/scss/tokens/_transitions.scss +27 -0
  71. package/scss/tokens/_typography.scss +63 -0
  72. package/scss/tokens/_z-index.scss +21 -0
  73. package/scss/utilities/_animation.scss +125 -0
  74. package/scss/utilities/_borders.scss +55 -0
  75. package/scss/utilities/_colors.scss +42 -0
  76. package/scss/utilities/_cursor.scss +28 -0
  77. package/scss/utilities/_display.scss +26 -0
  78. package/scss/utilities/_index.scss +20 -0
  79. package/scss/utilities/_interaction.scss +156 -0
  80. package/scss/utilities/_layout.scss +162 -0
  81. package/scss/utilities/_opacity.scss +9 -0
  82. package/scss/utilities/_overflow.scss +36 -0
  83. package/scss/utilities/_pointer-events.scss +6 -0
  84. package/scss/utilities/_position.scss +32 -0
  85. package/scss/utilities/_shadows.scss +11 -0
  86. package/scss/utilities/_sizing.scss +40 -0
  87. package/scss/utilities/_spacing.scss +42 -0
  88. package/scss/utilities/_transform.scss +43 -0
  89. package/scss/utilities/_typography.scss +163 -0
  90. package/scss/utilities/_z-index.scss +9 -0
  91. package/scss/variables/_breakpoints.scss +14 -0
  92. package/scss/variables/_container.scss +13 -0
  93. package/scss/variables/_global.scss +8 -0
  94. package/scss/variables/_grid.scss +7 -0
  95. package/scss/variables/_index.scss +7 -0
  96. package/scss/vendors/_index.scss +15 -0
@@ -0,0 +1,32 @@
1
+ // utilities/_position.scss
2
+ // Position utility classes.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ @use "../generators/class-generator" as gen;
6
+
7
+ @include gen.generate-utilities((
8
+ "position": (
9
+ property: position,
10
+ values: (
11
+ "static": static,
12
+ "relative": relative,
13
+ "absolute": absolute,
14
+ "fixed": fixed,
15
+ "sticky": sticky,
16
+ ),
17
+ responsive: true,
18
+ ),
19
+ ));
20
+
21
+ // Inset utilities
22
+ $-inset-values: ("0": 0px, "auto": auto, "full": 100%, "1\\/2": 50%);
23
+
24
+ @each $key, $val in $-inset-values {
25
+ .inset-#{$key} { inset: $val; }
26
+ .inset-x-#{$key} { left: $val; right: $val; }
27
+ .inset-y-#{$key} { top: $val; bottom: $val; }
28
+ .top-#{$key} { top: $val; }
29
+ .right-#{$key} { right: $val; }
30
+ .bottom-#{$key} { bottom: $val; }
31
+ .left-#{$key} { left: $val; }
32
+ }
@@ -0,0 +1,11 @@
1
+ // utilities/_shadows.scss
2
+ // Box-shadow utility classes from shadow tokens.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ @use "../tokens/shadows" as sh;
6
+
7
+ @each $key, $val in sh.$shadow-tokens {
8
+ .shadow-#{$key} { box-shadow: $val; }
9
+ }
10
+ // Shorthand
11
+ .shadow { box-shadow: sh.shadow("md"); }
@@ -0,0 +1,40 @@
1
+ // utilities/_sizing.scss
2
+ // Width and height utility classes from sizing tokens.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ @use "../tokens/sizing" as sz;
6
+
7
+ // Width utilities
8
+ @each $key, $val in sz.$sizing-tokens {
9
+ .w-#{$key} { width: $val; }
10
+ }
11
+
12
+ // Height utilities
13
+ @each $key, $val in sz.$sizing-tokens {
14
+ .h-#{$key} { height: $val; }
15
+ }
16
+
17
+ // Min / max width
18
+ .min-w-0 { min-width: 0; }
19
+ .min-w-full { min-width: 100%; }
20
+ .min-w-min { min-width: min-content; }
21
+ .min-w-max { min-width: max-content; }
22
+ .min-w-fit { min-width: fit-content; }
23
+
24
+ .max-w-none { max-width: none; }
25
+ .max-w-full { max-width: 100%; }
26
+ .max-w-min { max-width: min-content; }
27
+ .max-w-max { max-width: max-content; }
28
+ .max-w-fit { max-width: fit-content; }
29
+ .max-w-prose { max-width: 65ch; }
30
+
31
+ // Min / max height
32
+ .min-h-0 { min-height: 0; }
33
+ .min-h-full { min-height: 100%; }
34
+ .min-h-screen { min-height: 100vh; }
35
+ .min-h-svh { min-height: 100svh; }
36
+ .min-h-dvh { min-height: 100dvh; }
37
+
38
+ .max-h-none { max-height: none; }
39
+ .max-h-full { max-height: 100%; }
40
+ .max-h-screen { max-height: 100vh; }
@@ -0,0 +1,42 @@
1
+ // utilities/_spacing.scss
2
+ // Margin and padding utility classes from spacing tokens.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ @use "sass:map";
6
+ @use "../tokens/spacing" as sp;
7
+ @use "../generators/class-generator" as gen;
8
+
9
+ // Margin utilities
10
+ $-margin-values: map.merge(sp.$spacing-tokens, ("auto": auto));
11
+
12
+ @each $key, $val in $-margin-values {
13
+ .m-#{$key} { margin: $val; }
14
+ .mx-#{$key} { margin-left: $val; margin-right: $val; }
15
+ .my-#{$key} { margin-top: $val; margin-bottom: $val; }
16
+ .mt-#{$key} { margin-top: $val; }
17
+ .mr-#{$key} { margin-right: $val; }
18
+ .mb-#{$key} { margin-bottom: $val; }
19
+ .ml-#{$key} { margin-left: $val; }
20
+ .ms-#{$key} { margin-inline-start: $val; }
21
+ .me-#{$key} { margin-inline-end: $val; }
22
+ }
23
+
24
+ // Padding utilities
25
+ @each $key, $val in sp.$spacing-tokens {
26
+ .p-#{$key} { padding: $val; }
27
+ .px-#{$key} { padding-left: $val; padding-right: $val; }
28
+ .py-#{$key} { padding-top: $val; padding-bottom: $val; }
29
+ .pt-#{$key} { padding-top: $val; }
30
+ .pr-#{$key} { padding-right: $val; }
31
+ .pb-#{$key} { padding-bottom: $val; }
32
+ .pl-#{$key} { padding-left: $val; }
33
+ .ps-#{$key} { padding-inline-start: $val; }
34
+ .pe-#{$key} { padding-inline-end: $val; }
35
+ }
36
+
37
+ // Gap utilities
38
+ @each $key, $val in sp.$spacing-tokens {
39
+ .gap-#{$key} { gap: $val; }
40
+ .gap-x-#{$key} { column-gap: $val; }
41
+ .gap-y-#{$key} { row-gap: $val; }
42
+ }
@@ -0,0 +1,43 @@
1
+ // utilities/_transform.scss
2
+ // Transform utility classes.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ @use "sass:list";
6
+
7
+ // Transform utilities
8
+
9
+ // GPU compositing layer
10
+ .transform-gpu { transform: translateZ(0); }
11
+ .transform-none { transform: none; }
12
+
13
+ // Translate
14
+ $-translate-values: ("0": 0px, "1": 0.25rem, "2": 0.5rem, "4": 1rem, "8": 2rem,
15
+ "full": 100%, "1\\/2": 50%, "-full": -100%, "-1\\/2": -50%);
16
+
17
+ @each $key, $val in $-translate-values {
18
+ .translate-x-#{$key} { transform: translateX($val); }
19
+ .translate-y-#{$key} { transform: translateY($val); }
20
+ }
21
+
22
+ // Rotate
23
+ @each $deg in 0, 1, 2, 3, 6, 12, 45, 90, 180 {
24
+ .rotate-#{$deg} { transform: rotate(#{$deg}deg); }
25
+ .-rotate-#{$deg} { transform: rotate(-#{$deg}deg); }
26
+ }
27
+
28
+ // Scale
29
+ $-scale-values: ("0": 0, "50": .5, "75": .75, "90": .9, "95": .95,
30
+ "100": 1, "105": 1.05, "110": 1.1, "125": 1.25, "150": 1.5);
31
+
32
+ @each $key, $val in $-scale-values {
33
+ .scale-#{$key} { transform: scale($val); }
34
+ .scale-x-#{$key} { transform: scaleX($val); }
35
+ .scale-y-#{$key} { transform: scaleY($val); }
36
+ }
37
+
38
+ // Transform origin
39
+ .origin-center { transform-origin: center; }
40
+ .origin-top { transform-origin: top; }
41
+ .origin-right { transform-origin: right; }
42
+ .origin-bottom { transform-origin: bottom; }
43
+ .origin-left { transform-origin: left; }
@@ -0,0 +1,163 @@
1
+ // utilities/_typography.scss
2
+ // Typography utility classes — text-align, size, weight, leading, tracking,
3
+ // decoration, transform, whitespace, overflow, font-family, font-style.
4
+ // ─────────────────────────────────────────────────────────────
5
+
6
+ @use "sass:map";
7
+ @use "../tokens/typography" as ty;
8
+ @use "../generators/class-generator" as gen;
9
+
10
+ // ── Text align ───────────────────────────────────────────────────────────────
11
+
12
+ @include gen.generate-utilities((
13
+ "text-align": (
14
+ property: text-align,
15
+ prefix: "text",
16
+ values: (
17
+ "left": left,
18
+ "center": center,
19
+ "right": right,
20
+ "justify": justify,
21
+ "start": start,
22
+ "end": end,
23
+ ),
24
+ responsive: true,
25
+ ),
26
+ ));
27
+
28
+ // ── Font size ────────────────────────────────────────────────────────────────
29
+
30
+ @each $key, $val in ty.$font-size-tokens {
31
+ .text-#{$key} { font-size: $val; }
32
+ }
33
+
34
+ // ── Font weight ──────────────────────────────────────────────────────────────
35
+
36
+ @each $key, $val in ty.$font-weight-tokens {
37
+ .font-#{$key} { font-weight: $val; }
38
+ }
39
+
40
+ // ── Font family ──────────────────────────────────────────────────────────────
41
+
42
+ @each $key, $val in ty.$font-family-tokens {
43
+ .font-#{$key} { font-family: $val; }
44
+ }
45
+
46
+ // ── Font style ───────────────────────────────────────────────────────────────
47
+
48
+ .italic { font-style: italic; }
49
+ .not-italic { font-style: normal; }
50
+
51
+ // ── Line height (leading) ────────────────────────────────────────────────────
52
+
53
+ @each $key, $val in ty.$line-height-tokens {
54
+ .leading-#{$key} { line-height: $val; }
55
+ }
56
+
57
+ // ── Letter spacing (tracking) ────────────────────────────────────────────────
58
+
59
+ @each $key, $val in ty.$letter-spacing-tokens {
60
+ .tracking-#{$key} { letter-spacing: $val; }
61
+ }
62
+
63
+ // ── Text decoration ──────────────────────────────────────────────────────────
64
+
65
+ .underline { text-decoration-line: underline; }
66
+ .overline { text-decoration-line: overline; }
67
+ .line-through { text-decoration-line: line-through; }
68
+ .no-underline { text-decoration-line: none; }
69
+
70
+ // Decoration style
71
+ .decoration-solid { text-decoration-style: solid; }
72
+ .decoration-dashed { text-decoration-style: dashed; }
73
+ .decoration-dotted { text-decoration-style: dotted; }
74
+ .decoration-double { text-decoration-style: double; }
75
+ .decoration-wavy { text-decoration-style: wavy; }
76
+
77
+ // Decoration thickness
78
+ .decoration-auto { text-decoration-thickness: auto; }
79
+ .decoration-1 { text-decoration-thickness: 1px; }
80
+ .decoration-2 { text-decoration-thickness: 2px; }
81
+ .decoration-4 { text-decoration-thickness: 4px; }
82
+ .decoration-8 { text-decoration-thickness: 8px; }
83
+
84
+ // ── Text transform ───────────────────────────────────────────────────────────
85
+
86
+ .uppercase { text-transform: uppercase; }
87
+ .lowercase { text-transform: lowercase; }
88
+ .capitalize { text-transform: capitalize; }
89
+ .normal-case { text-transform: none; }
90
+
91
+ // ── Text overflow ────────────────────────────────────────────────────────────
92
+
93
+ .text-ellipsis { text-overflow: ellipsis; }
94
+ .text-clip { text-overflow: clip; }
95
+
96
+ // ── Whitespace ───────────────────────────────────────────────────────────────
97
+
98
+ @include gen.generate-utilities((
99
+ "whitespace": (
100
+ property: white-space,
101
+ prefix: "whitespace",
102
+ values: (
103
+ "normal": normal,
104
+ "nowrap": nowrap,
105
+ "pre": pre,
106
+ "pre-line": pre-line,
107
+ "pre-wrap": pre-wrap,
108
+ "break-spaces": break-spaces,
109
+ ),
110
+ ),
111
+ ));
112
+
113
+ // ── Word break ───────────────────────────────────────────────────────────────
114
+
115
+ .break-normal { overflow-wrap: normal; word-break: normal; }
116
+ .break-words { overflow-wrap: break-word; }
117
+ .break-all { word-break: break-all; }
118
+ .break-keep { word-break: keep-all; }
119
+
120
+ // ── Text indent ──────────────────────────────────────────────────────────────
121
+
122
+ .indent-0 { text-indent: 0; }
123
+ .indent-4 { text-indent: 1rem; }
124
+ .indent-8 { text-indent: 2rem; }
125
+
126
+ // ── Vertical align ───────────────────────────────────────────────────────────
127
+
128
+ @include gen.generate-utilities((
129
+ "align": (
130
+ property: vertical-align,
131
+ prefix: "align",
132
+ values: (
133
+ "baseline": baseline,
134
+ "top": top,
135
+ "middle": middle,
136
+ "bottom": bottom,
137
+ "text-top": text-top,
138
+ "text-bottom": text-bottom,
139
+ "sub": sub,
140
+ "super": super,
141
+ ),
142
+ ),
143
+ ));
144
+
145
+ // ── List style ───────────────────────────────────────────────────────────────
146
+
147
+ .list-none { list-style-type: none; }
148
+ .list-disc { list-style-type: disc; }
149
+ .list-decimal { list-style-type: decimal; }
150
+ .list-inside { list-style-position: inside; }
151
+ .list-outside { list-style-position: outside; }
152
+
153
+ // ── Smooth font rendering ────────────────────────────────────────────────────
154
+
155
+ .antialiased {
156
+ -webkit-font-smoothing: antialiased;
157
+ -moz-osx-font-smoothing: grayscale;
158
+ }
159
+
160
+ .subpixel-antialiased {
161
+ -webkit-font-smoothing: auto;
162
+ -moz-osx-font-smoothing: auto;
163
+ }
@@ -0,0 +1,9 @@
1
+ // utilities/_z-index.scss
2
+ // Z-index utility classes from z-index tokens.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ @use "../tokens/z-index" as zi;
6
+
7
+ @each $key, $val in zi.$z-index-tokens {
8
+ .z-#{$key} { z-index: $val; }
9
+ }
@@ -0,0 +1,14 @@
1
+ // variables/_breakpoints.scss
2
+ // Named breakpoint map used by the responsive engine.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ @use "sass:map";
6
+
7
+ $breakpoints: (
8
+ "xs": 0px,
9
+ "sm": 640px,
10
+ "md": 768px,
11
+ "lg": 1024px,
12
+ "xl": 1280px,
13
+ "2xl": 1536px,
14
+ ) !default;
@@ -0,0 +1,13 @@
1
+ // variables/_container.scss
2
+ // Container width constraints per breakpoint.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ $container-max-widths: (
6
+ "sm": 640px,
7
+ "md": 768px,
8
+ "lg": 1024px,
9
+ "xl": 1280px,
10
+ "2xl": 1400px,
11
+ ) !default;
12
+
13
+ $container-padding-x: 1rem !default;
@@ -0,0 +1,8 @@
1
+ // variables/_global.scss
2
+ // Top-level global SCSS variables (prefix, base font size, etc.)
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ $mastors-prefix: "" !default; // e.g. "m-" → .m-flex
6
+ $base-font-size: 16px !default;
7
+ $base-line-height: 1.5 !default;
8
+ $base-font-family: system-ui, -apple-system, sans-serif !default;
@@ -0,0 +1,7 @@
1
+ // variables/_grid.scss
2
+ // Grid system configuration variables.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ $grid-columns: 12 !default;
6
+ $grid-gutter: 1.5rem !default;
7
+ $grid-row-gap: 1.5rem !default;
@@ -0,0 +1,7 @@
1
+ // variables/_index.scss
2
+ // ─────────────────────────────────────────────────────────────
3
+
4
+ @forward "breakpoints";
5
+ @forward "grid";
6
+ @forward "container";
7
+ @forward "global";
@@ -0,0 +1,15 @@
1
+ // vendors/_index.scss
2
+ // Third-party CSS/SCSS integrations and overrides.
3
+ // ─────────────────────────────────────────────────────────────
4
+
5
+ // INTENTIONAL STUB — reserved for third-party CSS overrides.
6
+ // It is deliberately empty at v1.0.
7
+ // How to add a vendor override:
8
+ // 1. Create a partial: vendors/_<vendor-name>-overrides.scss
9
+ // 2. Forward it here: @forward "<vendor-name>-overrides";
10
+ // 3. Keep overrides scoped and minimal — prefer custom properties over
11
+ // re-declarations wherever the vendor library supports them.
12
+ // Example future entries:
13
+ // @forward "normalize-overrides";
14
+ // @forward "floating-ui-overrides";
15
+