breakouts 0.0.4 → 0.0.7
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 +164 -0
- package/dist/breakouts.css +155 -0
- package/dist/breakouts.min.css +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -31,6 +31,170 @@ Breakouts includes a small set of layout-focused utility classes to help you bui
|
|
|
31
31
|
| `.feature` | Wider area used for highlighting visual components |
|
|
32
32
|
| `.full` | Full-width layout spanning the entire grid |
|
|
33
33
|
|
|
34
|
+
## 🧩 Extending the Framework
|
|
35
|
+
|
|
36
|
+
Breakouts is fully configurable — you can override its core variables before importing it.
|
|
37
|
+
|
|
38
|
+
### 🔁 Example: Override the color palette
|
|
39
|
+
|
|
40
|
+
```scss
|
|
41
|
+
$colors: (
|
|
42
|
+
primary: #ff6600,
|
|
43
|
+
secondary: #222222,
|
|
44
|
+
background: #fefefe,
|
|
45
|
+
text: #111
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
@use "breakouts";
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This replaces the default color palette defined in the framework. You can override any variable marked with !default.
|
|
52
|
+
|
|
53
|
+
## 🔌 Use Only What You Need
|
|
54
|
+
|
|
55
|
+
Breakouts is modular and each part of the framework can be imported individually.
|
|
56
|
+
|
|
57
|
+
### Import specific modules
|
|
58
|
+
|
|
59
|
+
If you only want color utilities, you can import them directly:
|
|
60
|
+
|
|
61
|
+
```scss
|
|
62
|
+
@use "breakouts/theme/colors" as *;
|
|
63
|
+
|
|
64
|
+
@include text-color-utilities();
|
|
65
|
+
@include bg-color-utilities();
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
If you only need grid layout helpers:
|
|
69
|
+
|
|
70
|
+
```scss
|
|
71
|
+
@use "breakouts/layout/grid";
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This gives you full control over what gets compiled into your CSS, keeping it lean and optimized for your project.
|
|
75
|
+
|
|
76
|
+
## 🧱 Define Your Own Utilities on Top
|
|
77
|
+
|
|
78
|
+
Breakouts exposes a consistent set of CSS variables (e.g. `--color-primary`, `--color-background`, etc.) that you can reuse to build your own custom components or utility classes.
|
|
79
|
+
|
|
80
|
+
### Example: custom button style
|
|
81
|
+
|
|
82
|
+
```scss
|
|
83
|
+
.button {
|
|
84
|
+
background-color: var(--color-primary);
|
|
85
|
+
color: var(--color-background);
|
|
86
|
+
padding: 0.5rem 1rem;
|
|
87
|
+
border: none;
|
|
88
|
+
border-radius: 0.25rem;
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.button:hover {
|
|
94
|
+
background-color: var(--color-secondary);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
By using the same design tokens, your custom elements stay visually aligned with the rest of the system.
|
|
99
|
+
|
|
100
|
+
This approach encourages consistency while giving you full creative freedom.
|
|
101
|
+
|
|
102
|
+
## ✍️ Typography
|
|
103
|
+
|
|
104
|
+
Breakouts includes base typographic styles to ensure clean, readable text with consistent rhythm and spacing.
|
|
105
|
+
|
|
106
|
+
- Responsive font sizing and heading scale
|
|
107
|
+
- Theme-based color integration
|
|
108
|
+
- Styled links and paragraphs
|
|
109
|
+
- Easily extendable via SCSS variables
|
|
110
|
+
|
|
111
|
+
```scss
|
|
112
|
+
body {
|
|
113
|
+
font-family: system-ui, sans-serif;
|
|
114
|
+
font-size: 1rem;
|
|
115
|
+
line-height: 1.6;
|
|
116
|
+
color: var(--color-text);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
h1, h2, h3, h4, h5, h6 {
|
|
120
|
+
line-height: 1.2;
|
|
121
|
+
font-weight: 600;
|
|
122
|
+
margin: 2rem 0 1rem;
|
|
123
|
+
color: var(--color-text);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
p {
|
|
127
|
+
margin: 1rem 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
a {
|
|
131
|
+
color: var(--color-primary);
|
|
132
|
+
text-decoration: underline;
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
color: var(--color-secondary);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
You can override the heading scale, base sizes, and fonts by defining your own variables before importing Breakouts.
|
|
141
|
+
|
|
142
|
+
## 🌙 Dark Mode Support
|
|
143
|
+
|
|
144
|
+
Breakouts includes built-in support for **dark mode**, using CSS variables and system preferences.
|
|
145
|
+
|
|
146
|
+
### 🌓 Automatic dark mode
|
|
147
|
+
|
|
148
|
+
By default, the framework responds to the user's system setting using:
|
|
149
|
+
|
|
150
|
+
```scss
|
|
151
|
+
@media (prefers-color-scheme: dark) {
|
|
152
|
+
:root {
|
|
153
|
+
// Dark color variables
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
This means all your color utility classes like .bg-primary, .text-muted, etc., automatically switch based on the user's device.
|
|
159
|
+
|
|
160
|
+
### 🌘 Manual Override (Optional)
|
|
161
|
+
|
|
162
|
+
If you want to control dark mode manually—rather than relying on the user's system preferences—you can use the `.dark` class.
|
|
163
|
+
|
|
164
|
+
Apply it to the root HTML element:
|
|
165
|
+
|
|
166
|
+
```html
|
|
167
|
+
<html class="dark">
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
When this class is present, Breakouts will use the dark color palette regardless of system settings.
|
|
171
|
+
|
|
172
|
+
This is ideal for implementing a light/dark theme toggle in your application via JavaScript or local storage.
|
|
173
|
+
|
|
174
|
+
All color-based utility classes like .text-* and .bg-* will respond automatically, as they rely on CSS variables.
|
|
175
|
+
|
|
176
|
+
### ✅ Compatible with All Color Utilities
|
|
177
|
+
|
|
178
|
+
All utility classes that rely on colors—such as:
|
|
179
|
+
|
|
180
|
+
- `.text-primary`
|
|
181
|
+
- `.bg-surface`
|
|
182
|
+
- `.text-muted`
|
|
183
|
+
- `.bg-secondary`
|
|
184
|
+
|
|
185
|
+
...are automatically compatible with dark mode.
|
|
186
|
+
|
|
187
|
+
This is possible because Breakouts uses CSS custom properties (variables) for all colors. When the color mode changes (automatically or via `.dark` class), the variables are updated, and the utilities respond instantly without requiring any changes to your HTML.
|
|
188
|
+
|
|
189
|
+
You can keep writing markup the same way in both themes:
|
|
190
|
+
|
|
191
|
+
```html
|
|
192
|
+
<div class="bg-background text-text">
|
|
193
|
+
<p class="text-muted">This works in both light and dark modes.</p>
|
|
194
|
+
</div>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
|
|
34
198
|
## 🛠️ Development
|
|
35
199
|
|
|
36
200
|
To build or modify Breakouts locally, follow these steps:
|
package/dist/breakouts.css
CHANGED
|
@@ -1,3 +1,70 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--color-background: #ffffff;
|
|
3
|
+
--color-surface: #f0f0f0;
|
|
4
|
+
--color-text: #111111;
|
|
5
|
+
--color-muted: #666666;
|
|
6
|
+
--color-primary: #0055ff;
|
|
7
|
+
--color-secondary: #0033aa;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dark,
|
|
11
|
+
.dark :root {
|
|
12
|
+
--color-background: #111111;
|
|
13
|
+
--color-surface: #1a1a1a;
|
|
14
|
+
--color-text: #eeeeee;
|
|
15
|
+
--color-muted: #aaaaaa;
|
|
16
|
+
--color-primary: #88b0ff;
|
|
17
|
+
--color-secondary: #cdd9ff;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.light,
|
|
21
|
+
.light :root {
|
|
22
|
+
--color-background: #ffffff;
|
|
23
|
+
--color-surface: #f0f0f0;
|
|
24
|
+
--color-text: #111111;
|
|
25
|
+
--color-muted: #666666;
|
|
26
|
+
--color-primary: #0055ff;
|
|
27
|
+
--color-secondary: #0033aa;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (prefers-color-scheme: dark) {
|
|
31
|
+
:root:not(.light):not(.dark) {
|
|
32
|
+
--color-background: #111111;
|
|
33
|
+
--color-surface: #1a1a1a;
|
|
34
|
+
--color-text: #eeeeee;
|
|
35
|
+
--color-muted: #aaaaaa;
|
|
36
|
+
--color-primary: #88b0ff;
|
|
37
|
+
--color-secondary: #cdd9ff;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.bg-background {
|
|
41
|
+
background-color: var(--color-background);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.bg-surface {
|
|
45
|
+
background-color: var(--color-surface);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.bg-primary {
|
|
49
|
+
background-color: var(--color-primary);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.bg-secondary {
|
|
53
|
+
background-color: var(--color-secondary);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.text-text {
|
|
57
|
+
color: var(--color-text);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.text-background {
|
|
61
|
+
color: var(--color-background);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.text-muted {
|
|
65
|
+
color: var(--color-muted);
|
|
66
|
+
}
|
|
67
|
+
|
|
1
68
|
/* Basic reset */
|
|
2
69
|
*,
|
|
3
70
|
*::before,
|
|
@@ -15,6 +82,81 @@ body {
|
|
|
15
82
|
overflow-x: hidden;
|
|
16
83
|
}
|
|
17
84
|
|
|
85
|
+
body {
|
|
86
|
+
padding: 2rem;
|
|
87
|
+
font-family: system-ui, sans-serif;
|
|
88
|
+
line-height: 1.6;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
body {
|
|
92
|
+
font-family: system-ui, sans-serif;
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
line-height: 1.6;
|
|
95
|
+
color: var(--color-text);
|
|
96
|
+
background-color: var(--color-background);
|
|
97
|
+
margin: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
h1 {
|
|
101
|
+
font-size: 2.25rem;
|
|
102
|
+
line-height: 1.2;
|
|
103
|
+
margin: 2rem 0 1rem;
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
color: var(--color-text);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
h2 {
|
|
109
|
+
font-size: 1.75rem;
|
|
110
|
+
line-height: 1.2;
|
|
111
|
+
margin: 2rem 0 1rem;
|
|
112
|
+
font-weight: 600;
|
|
113
|
+
color: var(--color-text);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
h3 {
|
|
117
|
+
font-size: 1.5rem;
|
|
118
|
+
line-height: 1.2;
|
|
119
|
+
margin: 2rem 0 1rem;
|
|
120
|
+
font-weight: 600;
|
|
121
|
+
color: var(--color-text);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
h4 {
|
|
125
|
+
font-size: 1.25rem;
|
|
126
|
+
line-height: 1.2;
|
|
127
|
+
margin: 2rem 0 1rem;
|
|
128
|
+
font-weight: 600;
|
|
129
|
+
color: var(--color-text);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
h5 {
|
|
133
|
+
font-size: 1.125rem;
|
|
134
|
+
line-height: 1.2;
|
|
135
|
+
margin: 2rem 0 1rem;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
color: var(--color-text);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
h6 {
|
|
141
|
+
font-size: 1rem;
|
|
142
|
+
line-height: 1.2;
|
|
143
|
+
margin: 2rem 0 1rem;
|
|
144
|
+
font-weight: 600;
|
|
145
|
+
color: var(--color-text);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
p {
|
|
149
|
+
margin: 1rem 0;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
a {
|
|
153
|
+
color: var(--color-primary);
|
|
154
|
+
text-decoration: underline;
|
|
155
|
+
}
|
|
156
|
+
a:hover {
|
|
157
|
+
color: var(--color-secondary);
|
|
158
|
+
}
|
|
159
|
+
|
|
18
160
|
.container {
|
|
19
161
|
margin-inline: auto;
|
|
20
162
|
max-width: 72rem;
|
|
@@ -62,4 +204,17 @@ body {
|
|
|
62
204
|
grid-column: full;
|
|
63
205
|
}
|
|
64
206
|
|
|
207
|
+
.grid {
|
|
208
|
+
display: grid;
|
|
209
|
+
grid-template-columns: 1fr minmax(0, var(--container-max-width, 64rem)) 1fr;
|
|
210
|
+
gap: var(--gap);
|
|
211
|
+
}
|
|
212
|
+
.grid > * {
|
|
213
|
+
grid-column: 2;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.grid--full > * {
|
|
217
|
+
grid-column: 1/-1;
|
|
218
|
+
}
|
|
219
|
+
|
|
65
220
|
/*# sourceMappingURL=breakouts.css.map */
|
package/dist/breakouts.min.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}html,body{margin:0;padding:0;width:100%;overflow-x:hidden}.container{margin-inline:auto;max-width:72rem;padding-inline:1rem}.full-bleed{width:100vw;margin-left:50%;transform:translateX(-50%)}.breakout{width:100vw;margin-left:calc(-1*(100vw - 100%)/2)}:root{--gap: clamp(1rem, 6vw, 3rem);--full: minmax(var(--gap), 1fr);--feature: minmax(0, 5rem);--popout: minmax(0, 2rem);--content: min(50ch, 100% - var(--gap) * 2)}.breakouts-grid{display:grid;grid-template-columns:[full-start] var(--full) [feature-start] var(--feature) [popout-start] var(--popout) [content-start] var(--content) [content-end] var(--popout) [popout-end] var(--feature) [feature-end] var(--full) [full-end];gap:var(--gap)}.content{grid-column:content}.popout{grid-column:popout}.feature{grid-column:feature}.full{grid-column:full}/*# sourceMappingURL=breakouts.min.css.map */
|
|
1
|
+
:root{--color-background: #ffffff;--color-surface: #f0f0f0;--color-text: #111111;--color-muted: #666666;--color-primary: #0055ff;--color-secondary: #0033aa}.dark,.dark :root{--color-background: #111111;--color-surface: #1a1a1a;--color-text: #eeeeee;--color-muted: #aaaaaa;--color-primary: #88b0ff;--color-secondary: #cdd9ff}.light,.light :root{--color-background: #ffffff;--color-surface: #f0f0f0;--color-text: #111111;--color-muted: #666666;--color-primary: #0055ff;--color-secondary: #0033aa}@media(prefers-color-scheme: dark){:root:not(.light):not(.dark){--color-background: #111111;--color-surface: #1a1a1a;--color-text: #eeeeee;--color-muted: #aaaaaa;--color-primary: #88b0ff;--color-secondary: #cdd9ff}}.bg-background{background-color:var(--color-background)}.bg-surface{background-color:var(--color-surface)}.bg-primary{background-color:var(--color-primary)}.bg-secondary{background-color:var(--color-secondary)}.text-text{color:var(--color-text)}.text-background{color:var(--color-background)}.text-muted{color:var(--color-muted)}*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}html,body{margin:0;padding:0;width:100%;overflow-x:hidden}body{padding:2rem;font-family:system-ui,sans-serif;line-height:1.6}body{font-family:system-ui,sans-serif;font-size:1rem;line-height:1.6;color:var(--color-text);background-color:var(--color-background);margin:0}h1{font-size:2.25rem;line-height:1.2;margin:2rem 0 1rem;font-weight:600;color:var(--color-text)}h2{font-size:1.75rem;line-height:1.2;margin:2rem 0 1rem;font-weight:600;color:var(--color-text)}h3{font-size:1.5rem;line-height:1.2;margin:2rem 0 1rem;font-weight:600;color:var(--color-text)}h4{font-size:1.25rem;line-height:1.2;margin:2rem 0 1rem;font-weight:600;color:var(--color-text)}h5{font-size:1.125rem;line-height:1.2;margin:2rem 0 1rem;font-weight:600;color:var(--color-text)}h6{font-size:1rem;line-height:1.2;margin:2rem 0 1rem;font-weight:600;color:var(--color-text)}p{margin:1rem 0}a{color:var(--color-primary);text-decoration:underline}a:hover{color:var(--color-secondary)}.container{margin-inline:auto;max-width:72rem;padding-inline:1rem}.full-bleed{width:100vw;margin-left:50%;transform:translateX(-50%)}.breakout{width:100vw;margin-left:calc(-1*(100vw - 100%)/2)}:root{--gap: clamp(1rem, 6vw, 3rem);--full: minmax(var(--gap), 1fr);--feature: minmax(0, 5rem);--popout: minmax(0, 2rem);--content: min(50ch, 100% - var(--gap) * 2)}.breakouts-grid{display:grid;grid-template-columns:[full-start] var(--full) [feature-start] var(--feature) [popout-start] var(--popout) [content-start] var(--content) [content-end] var(--popout) [popout-end] var(--feature) [feature-end] var(--full) [full-end];gap:var(--gap)}.content{grid-column:content}.popout{grid-column:popout}.feature{grid-column:feature}.full{grid-column:full}.grid{display:grid;grid-template-columns:1fr minmax(0, var(--container-max-width, 64rem)) 1fr;gap:var(--gap)}.grid>*{grid-column:2}.grid--full>*{grid-column:1/-1}/*# sourceMappingURL=breakouts.min.css.map */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "breakouts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "A personal SCSS/CSS layout utility framework.",
|
|
5
5
|
"main": "dist/breakouts.css",
|
|
6
6
|
"files": [
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"dist/breakouts.min.css"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "sass src/_index.scss dist/breakouts.css --style=expanded && sass src/_index.scss dist/breakouts.min.css --style=compressed"
|
|
11
|
+
"build": "sass src/_index.scss dist/breakouts.css --style=expanded && sass src/_index.scss dist/breakouts.min.css --style=compressed && cp dist/breakouts.css docs/breakouts.css",
|
|
12
|
+
"release:patch": "npm run build && npm version patch && git push && git push --follow-tags && npm publish --access public",
|
|
13
|
+
"release:minor": "npm run build && npm version minor && git push && git push --follow-tags && npm publish --access public",
|
|
14
|
+
"release:major": "npm run build && npm version major && git push && git push --follow-tags && npm publish --access public"
|
|
12
15
|
},
|
|
13
16
|
"author": "Tuo Nome",
|
|
14
17
|
"license": "MIT",
|