@brady_h/styles 1.0.16 → 1.0.18

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.
package/README.md CHANGED
@@ -17,33 +17,36 @@ The package provides two ways to use its styling resources:
17
17
  - **Sass APIs:** Variables, maps, functions, breakpoints, and mixins.
18
18
  - **Utility classes:** Predefined global CSS classes for common styling needs.
19
19
 
20
- ### Sass Variables, Functions & Mixins
20
+ ### Important: Importing Sass Modules
21
21
 
22
- Import the package into any SCSS file:
22
+ For compatibility with Next.js Turbopack, import each Sass module individually instead of importing the main package entry point.
23
23
 
24
24
  ```scss
25
- @use "@brady_h/styles" as *;
26
-
27
- .container {
28
- @include flex-center;
29
-
30
- @include mobile-query {
31
- flex-direction: column;
32
- }
33
- }
25
+ @use "@brady_h/styles/src/variables" as vars;
26
+ @use "@brady_h/styles/src/breakpoints" as bp;
27
+ @use "@brady_h/styles/src/functions" as fn;
28
+ @use "@brady_h/styles/src/mixins" as mixins;
34
29
  ```
35
30
 
36
- Using a namespace is also supported:
31
+ You can import only the modules you need.
32
+
33
+ ### Example
37
34
 
38
35
  ```scss
39
- @use "@brady_h/styles" as styles;
36
+ @use "sass:map";
37
+ @use "@brady_h/styles/src/variables" as vars;
38
+ @use "@brady_h/styles/src/mixins" as mixins;
39
+ @use "@brady_h/styles/src/functions" as fn;
40
40
 
41
41
  .container {
42
- @include styles.flex-center;
43
- padding: styles.to-rem(24px);
42
+ @include mixins.flex-center;
43
+ padding: map.get(vars.$spacing, 4);
44
+ font-size: fn.to-rem(16px);
44
45
  }
45
46
  ```
46
47
 
48
+ Using namespaces helps avoid naming conflicts between your application's Sass resources and the package.
49
+
47
50
  ## Available Features
48
51
 
49
52
  ### Variables
@@ -70,12 +73,12 @@ Example:
70
73
 
71
74
  ```scss
72
75
  @use "sass:map";
73
- @use "@brady_h/styles" as *;
76
+ @use "@brady_h/styles/src/variables" as vars;
74
77
 
75
78
  .card {
76
- padding: map.get($spacing, 4);
77
- border-radius: map.get($border-radius, md);
78
- box-shadow: map.get($box-shadow, md);
79
+ padding: map.get(vars.$spacing, 4);
80
+ border-radius: map.get(vars.$border-radius, md);
81
+ box-shadow: map.get(vars.$box-shadow, md);
79
82
  }
80
83
  ```
81
84
 
@@ -83,6 +86,12 @@ Example:
83
86
 
84
87
  Responsive breakpoint values and helper functions.
85
88
 
89
+ Import:
90
+
91
+ ```scss
92
+ @use "@brady_h/styles/src/breakpoints" as bp;
93
+ ```
94
+
86
95
  Default breakpoints:
87
96
 
88
97
  | Name | Width |
@@ -97,12 +106,12 @@ Default breakpoints:
97
106
  Example:
98
107
 
99
108
  ```scss
100
- @use "@brady_h/styles" as *;
109
+ @use "@brady_h/styles/src/breakpoints" as bp;
101
110
 
102
111
  .container {
103
112
  width: 100%;
104
113
 
105
- @include respond-up(md) {
114
+ @include bp.respond-up(md) {
106
115
  width: 80%;
107
116
  }
108
117
  }
@@ -112,6 +121,12 @@ Example:
112
121
 
113
122
  Reusable styling patterns for common layouts and responsive behavior.
114
123
 
124
+ Import:
125
+
126
+ ```scss
127
+ @use "@brady_h/styles/src/mixins" as mixins;
128
+ ```
129
+
115
130
  Examples include:
116
131
 
117
132
  - `flex-center`
@@ -138,11 +153,11 @@ Examples include:
138
153
  Example:
139
154
 
140
155
  ```scss
141
- @use "@brady_h/styles" as *;
156
+ @use "@brady_h/styles/src/mixins" as mixins;
142
157
 
143
158
  .card {
144
- @include flex-column;
145
- @include focus-ring;
159
+ @include mixins.flex-column;
160
+ @include mixins.focus-ring;
146
161
  }
147
162
  ```
148
163
 
@@ -150,6 +165,12 @@ Example:
150
165
 
151
166
  Reusable Sass functions for working with design tokens, units, colors, sizing, and calculations.
152
167
 
168
+ Import:
169
+
170
+ ```scss
171
+ @use "@brady_h/styles/src/functions" as fn;
172
+ ```
173
+
153
174
  Examples include:
154
175
 
155
176
  - `to-rem()`
@@ -173,10 +194,10 @@ Examples include:
173
194
  Example:
174
195
 
175
196
  ```scss
176
- @use "@brady_h/styles" as *;
197
+ @use "@brady_h/styles/src/functions" as fn;
177
198
 
178
199
  .heading {
179
- font-size: to-rem(32px);
200
+ font-size: fn.to-rem(32px);
180
201
  }
181
202
  ```
182
203
 
@@ -360,7 +381,9 @@ styles/
360
381
 
361
382
  ## Notes
362
383
 
363
- - Sass variables, functions, breakpoints, and mixins are imported through the main package entry point.
384
+ - Import Sass modules individually using their package paths.
385
+ - Variables, functions, breakpoints, and mixins can be imported independently.
386
+ - Some modules internally depend on other modules.
364
387
  - Utility classes must be imported separately into a global stylesheet.
365
388
  - Utility classes are globally scoped, not CSS-module scoped.
366
389
  - Projects can customize their own colors, fonts, and application-specific design tokens.
package/package.json CHANGED
@@ -1,21 +1,22 @@
1
1
  {
2
2
  "name": "@brady_h/styles",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "description": "Shared SCSS styling foundation for projects",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "src"
8
8
  ],
9
9
  "exports": {
10
- ".": "./src/_index.scss",
10
+ ".": "./src/index.scss",
11
11
  "./variables": "./src/_variables.scss",
12
12
  "./breakpoints": "./src/_breakpoints.scss",
13
13
  "./functions": "./src/_functions.scss",
14
14
  "./mixins": "./src/_mixins.scss",
15
15
  "./classes": "./src/_classes.scss"
16
16
  },
17
- "sass": "./src/_index.scss",
18
- "style": "./src/_index.scss",
17
+ "main": "./src/index.scss",
18
+ "sass": "./src/index.scss",
19
+ "style": "./src/index.scss",
19
20
  "scripts": {
20
21
  "release:patch": "npm version patch && npm publish --access public",
21
22
  "release:minor": "npm version minor && npm publish --access public",
@@ -2,8 +2,8 @@
2
2
  @use "sass:math";
3
3
  @use "sass:map";
4
4
  @use "sass:meta";
5
- @use "./_variables" as vars;
6
- @use "./_breakpoints" as bp;
5
+ @use "variables" as vars;
6
+ @use "breakpoints" as bp;
7
7
 
8
8
  @function map-value($collection, $key, $fallback: null) {
9
9
  @if not map.has-key($collection, $key) {
package/src/_mixins.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  @use "sass:map";
2
- @use "./_breakpoints" as bp;
2
+ @use "breakpoints" as bp;
3
3
 
4
4
  @mixin respond-down($breakpoint: md) {
5
5
  @media (max-width: bp.breakpoint($breakpoint)) {
package/src/index.scss ADDED
@@ -0,0 +1,4 @@
1
+ @forward "variables.scss";
2
+ @forward "breakpoints.scss";
3
+ @forward "functions.scss";
4
+ @forward "mixins.scss";
package/src/_index.scss DELETED
@@ -1,4 +0,0 @@
1
- @forward "./variables";
2
- @forward "./breakpoints";
3
- @forward "./functions";
4
- @forward "./mixins";