@bamx/scss 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Bäumer Afonso Meissner GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "access": "public",
3
+ "author": "Dev <dev@bam-bam-bam-com> (https://bam-bam-bam.com/)",
4
+ "description": "SCSS Framework",
5
+ "directories": {
6
+ "lib": "src"
7
+ },
8
+ "exports": {
9
+ "sass": "./src/_index.scss"
10
+ },
11
+ "files": [
12
+ "src",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "keywords": [
17
+ "scss",
18
+ "sass",
19
+ "framework",
20
+ "frontend",
21
+ "bam-bam-bam"
22
+ ],
23
+ "license": "MIT",
24
+ "main": "src/_index.scss",
25
+ "name": "@bamx/scss",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/bam-bam-bam-com/scss.git"
29
+ },
30
+ "style": "src/_index.scss",
31
+ "version": "0.1.1"
32
+ }
@@ -0,0 +1,48 @@
1
+ @use 'sass:map' as map;
2
+ // @use "config" as *;
3
+ $breakpoints: (
4
+ xs: 375px,
5
+ s: 680px,
6
+ sm: 680px,
7
+ m: 768px,
8
+ md: 768px,
9
+ l: 1024px,
10
+ lg: 1024px,
11
+ xl: 1280px,
12
+ xxl: 1440px,
13
+ hd: 1920px,
14
+ ) !default !global;
15
+
16
+ @function breakpoint($key) {
17
+ @return map.get($breakpoints, $key);
18
+ }
19
+
20
+ @mixin mq-to($key) {
21
+ @media (width < breakpoint($key)) {
22
+ @content;
23
+ }
24
+ }
25
+
26
+ @mixin mq-from($key) {
27
+ @media (width >= breakpoint($key)) {
28
+ @content;
29
+ }
30
+ }
31
+
32
+ @mixin mq-range($from, $to) {
33
+ @media (breakpoint($from) <= width < breakpoint($to)) {
34
+ @content;
35
+ }
36
+ }
37
+
38
+ @mixin responsive-property($property, $breakpoint_value_map) {
39
+ @each $breakpoint, $value in $breakpoint_value_map {
40
+ @if ($breakpoint != default) {
41
+ @include mq-from($breakpoint) {
42
+ #{$property}: $value;
43
+ }
44
+ } @else {
45
+ #{$property}: $value;
46
+ }
47
+ }
48
+ }
package/src/_grid.scss ADDED
@@ -0,0 +1,59 @@
1
+ @use '@/scss/framework/framework-utils' as *;
2
+
3
+ /**
4
+ * Generates a grid definition for a grid with equal sized columns
5
+ *
6
+ * @param {number | custom css prop} $grid-columns grid column count; must be even and greate or equal than 4
7
+ * @param {number | custom css prop} $gutter-size grid gutter size
8
+ *
9
+ * @return grid definition
10
+ */
11
+ @function generate-content-grid($grid-columns: var(--default-grid-columns, 12), $gutter-size: var(--default-grid-gutter-size, 16px)) {
12
+ $_grid-columns: #{$grid-columns};
13
+ $_total-gutter-size: calc((#{$_grid-columns} - 1) * #{$gutter-size});
14
+
15
+ /* prettier-ignore */
16
+ $_content-width: calc(#{var(--page-width)} - 2 * #{var(--page-indent)} - 2 * #{var(--content-indent)});
17
+ $_column-size: minmax(0, calc(($_content-width - $_total-gutter-size) / $_grid-columns));
18
+
19
+ $cols-count: calc(($_grid-columns / 2) - 1);
20
+
21
+ /* prettier-ignore */
22
+ @return [grid-start]
23
+ repeat(
24
+ $cols-count,
25
+ [column-start] $_column-size [column-end] #{$gutter-size}
26
+ )
27
+ [column-start] $_column-size [column-end]
28
+ calc(#{var(--default-grid-gutter-size, 0px)} / 2)
29
+ [mid]
30
+ calc(#{var(--default-grid-gutter-size, 0px)} / 2)
31
+ repeat(
32
+ $cols-count,
33
+ [column-start] $_column-size [column-end] #{var(--default-grid-gutter-size)}
34
+ )
35
+ [column-start] $_column-size [column-end grid-end];
36
+ }
37
+
38
+ @mixin section-grid($content-grid: generate-content-grid()) {
39
+ display: grid;
40
+ column-gap: 0;
41
+
42
+ $_viewport-indent: calc((100% - #{var(--page-width)}) / 2);
43
+
44
+ @include v(
45
+ (
46
+ viewport-indent: (
47
+ default: 0px,
48
+ xs: $_viewport-indent,
49
+ ),
50
+ )
51
+ );
52
+
53
+ grid-template-columns:
54
+ [viewport-start] var(--viewport-indent)
55
+ [page-start] var(--page-indent)
56
+ [content-start] #{var(--content-indent)} $content-grid #{var(--content-indent)} [content-end]
57
+ var(--page-indent) [page-end]
58
+ var(--viewport-indent) [viewport-end];
59
+ }
@@ -0,0 +1,5 @@
1
+ @forward 'breakpoints';
2
+ @forward 'functions';
3
+ @forward 'mixins';
4
+ @forward 'grid';
5
+ @forward 'v';
package/src/_v.scss ADDED
@@ -0,0 +1,44 @@
1
+ @use 'sass:meta';
2
+ @use 'sass:string';
3
+ @use 'sass:list';
4
+ @use 'breakpoints';
5
+
6
+ @function get-var-name($key, $infix: '') {
7
+ $prefix: '';
8
+
9
+ @if $infix != '' {
10
+ $infix: $infix + '-';
11
+ }
12
+
13
+ @return #{$prefix}#{$infix}#{$key};
14
+ }
15
+
16
+ @mixin _output-value($var-base-name, $value) {
17
+ $var-name: get-var-name($var-base-name);
18
+ #{$var-name}: $value;
19
+ }
20
+
21
+ @mixin v($map_or_key, $value: null, $skipStore: false) {
22
+ $type: meta.type-of($map_or_key);
23
+
24
+ @if $type == map {
25
+ @each $var-base-name, $v in $map_or_key {
26
+ $var_name: get-var-name($var-base-name);
27
+
28
+ @if & {
29
+ @if (meta.type-of($v) == map) {
30
+ // write out vars in media queries
31
+ @include breakpoints.responsive-property($var_name, $v);
32
+ } @else if $v {
33
+ @include _output-value($var-base-name, $v);
34
+ }
35
+ }
36
+ }
37
+ } @else {
38
+ $var-base-name: $map_or_key;
39
+
40
+ @if & {
41
+ @include _output-value($var-base-name, $value);
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,12 @@
1
+ @use 'sass:math';
2
+
3
+ $default-min-bp: 320px !default !global;
4
+ $default-max-bp: 2560px !default !global;
5
+
6
+ @function clamped($min-px, $max-px, $min-bp: $default-min-bp, $max-bp: $default-max-bp) {
7
+ $slope: math.div($max-px - $min-px, $max-bp - $min-bp);
8
+ $intercept-px: $min-px - $slope * $min-bp;
9
+ $slope-vw: $slope * 100;
10
+
11
+ @return clamp(#{$min-px}, #{$slope-vw}vw + #{$intercept-px}, #{$max-px});
12
+ }
@@ -0,0 +1,2 @@
1
+ @forward 'clamped';
2
+ @forward 'shadows';
@@ -0,0 +1,21 @@
1
+ @use 'sass:math';
2
+ @use '../v' as *;
3
+
4
+ @function shadow-elevated($level: 0, $color: #{var(--color-shadow, #000)}) {
5
+ @if ($level == 1) {
6
+ @return 10px 10px 20px 0px color-mix(in srgb, $color 92%, transparent);
7
+ } @else if ($level == 2) {
8
+ @return 0px 30px 30px color-mix(in srgb, $color 25%, transparent);
9
+ } @else {
10
+ @return 0px 0px 0px 0px $color;
11
+ }
12
+ }
13
+
14
+ @function material-shadow($xOffset, $yOffset, $level, $color: #{var(--color-shadow, #000)}) {
15
+ // Material Design elevation levels (approximations)
16
+ $blur: $level * 4px; // Blur increases with level
17
+ $spread: $level * 1px; // Spread increases with level
18
+ $opacity: math.clamp(0, (1 - $level * 0.05), 1) * 100%;
19
+
20
+ @return #{$xOffset} #{$yOffset} #{$blur} #{$spread} color-mix(in srgb, #{$color} #{$opacity}, transparent);
21
+ }
@@ -0,0 +1,9 @@
1
+ @mixin font-smoothing($value: antialiased) {
2
+ @if $value == antialiased {
3
+ -webkit-font-smoothing: antialiased;
4
+ -moz-osx-font-smoothing: grayscale;
5
+ } @else {
6
+ -webkit-font-smoothing: subpixel-antialiased;
7
+ -moz-osx-font-smoothing: auto;
8
+ }
9
+ }
@@ -0,0 +1,8 @@
1
+ @mixin hover($selector: '&:hover', $hover: hover, $pointer: fine) {
2
+ // https://hover-pointer-media-query.glitch.me/
3
+ @media (hover: $hover) and (pointer: $pointer) {
4
+ #{$selector} {
5
+ @content;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,5 @@
1
+ @forward 'font-smoothing';
2
+ @forward 'hover';
3
+ @forward 'normalize';
4
+ @forward 'scrollbars';
5
+ @forward 'svg-auto-color';
@@ -0,0 +1,401 @@
1
+ @mixin normalize {
2
+ /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
3
+
4
+ /* Document
5
+ ========================================================================== */
6
+
7
+ /**
8
+ * 1. Correct the line height in all browsers.
9
+ * 2. Prevent adjustments of font size after orientation changes in iOS.
10
+ */
11
+
12
+ html {
13
+ line-height: 1.15;
14
+ /* 1 */
15
+ -webkit-text-size-adjust: 100%;
16
+ /* 2 */
17
+ }
18
+
19
+ /* Sections
20
+ ========================================================================== */
21
+
22
+ /**
23
+ * Remove the margin in all browsers.
24
+ */
25
+
26
+ body {
27
+ padding: 0;
28
+ margin: 0;
29
+ }
30
+
31
+ /**
32
+ * Render the `main` element consistently in IE.
33
+ */
34
+
35
+ main {
36
+ display: block;
37
+ }
38
+
39
+ figure: {
40
+ margin: 0;
41
+ }
42
+
43
+ svg {
44
+ vertical-align: middle;
45
+ }
46
+
47
+ video {
48
+ object-fit: fill;
49
+ background-size: 100% 100%;
50
+ }
51
+
52
+ /**
53
+ * Correct the font size and margin on `h1` elements within `section` and
54
+ * `article` contexts in Chrome, Firefox, and Safari.
55
+ */
56
+
57
+ h1 {
58
+ font-size: 2em;
59
+ margin: 0.67em 0;
60
+ }
61
+
62
+ /* Grouping content
63
+ ========================================================================== */
64
+
65
+ /**
66
+ * 1. Add the correct box sizing in Firefox.
67
+ * 2. Show the overflow in Edge and IE.
68
+ */
69
+
70
+ hr {
71
+ box-sizing: content-box;
72
+ /* 1 */
73
+ height: 0;
74
+ /* 1 */
75
+ overflow: visible;
76
+ /* 2 */
77
+ }
78
+
79
+ /**
80
+ * 1. Correct the inheritance and scaling of font size in all browsers.
81
+ * 2. Correct the odd `em` font sizing in all browsers.
82
+ */
83
+
84
+ pre {
85
+ font-family: monospace, monospace;
86
+ /* 1 */
87
+ font-size: 1em;
88
+ /* 2 */
89
+ }
90
+
91
+ /* Text-level semantics
92
+ ========================================================================== */
93
+
94
+ /**
95
+ * Remove the gray background on active links in IE 10.
96
+ */
97
+
98
+ a {
99
+ background-color: transparent;
100
+ }
101
+
102
+ /**
103
+ * 1. Remove the bottom border in Chrome 57-
104
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
105
+ */
106
+
107
+ abbr[title] {
108
+ border-bottom: none;
109
+ /* 1 */
110
+ text-decoration: underline;
111
+ /* 2 */
112
+ text-decoration: underline dotted;
113
+ /* 2 */
114
+ }
115
+
116
+ /**
117
+ * Add the correct font weight in Chrome, Edge, and Safari.
118
+ */
119
+
120
+ b,
121
+ strong {
122
+ font-weight: bolder;
123
+ }
124
+
125
+ /**
126
+ * 1. Correct the inheritance and scaling of font size in all browsers.
127
+ * 2. Correct the odd `em` font sizing in all browsers.
128
+ */
129
+
130
+ code,
131
+ kbd,
132
+ samp {
133
+ font-family: monospace, monospace;
134
+ /* 1 */
135
+ font-size: 1em;
136
+ /* 2 */
137
+ }
138
+
139
+ /**
140
+ * Add the correct font size in all browsers.
141
+ */
142
+
143
+ small {
144
+ font-size: 80%;
145
+ }
146
+
147
+ /**
148
+ * Prevent `sub` and `sup` elements from affecting the line height in
149
+ * all browsers.
150
+ */
151
+
152
+ sub,
153
+ sup {
154
+ font-size: 75%;
155
+ line-height: 0;
156
+ position: relative;
157
+ vertical-align: baseline;
158
+ }
159
+
160
+ sub {
161
+ bottom: -0.25em;
162
+ }
163
+
164
+ sup {
165
+ top: -0.5em;
166
+ }
167
+
168
+ /* Embedded content
169
+ ========================================================================== */
170
+
171
+ /**
172
+ * Remove the border on images inside links in IE 10.
173
+ */
174
+
175
+ img {
176
+ display: inline-block;
177
+ border-style: none;
178
+ vertical-align: middle;
179
+ }
180
+
181
+ picture {
182
+ display: contents;
183
+ }
184
+
185
+ /* Forms
186
+ ========================================================================== */
187
+
188
+ /**
189
+ * 1. Change the font styles in all browsers.
190
+ * 2. Remove the margin in Firefox and Safari.
191
+ */
192
+
193
+ button,
194
+ input,
195
+ optgroup,
196
+ select,
197
+ textarea {
198
+ font-family: inherit;
199
+ /* 1 */
200
+ font-size: 100%;
201
+ /* 1 */
202
+ line-height: 1.15;
203
+ /* 1 */
204
+ margin: 0;
205
+ /* 2 */
206
+ }
207
+
208
+ /**
209
+ * Show the overflow in IE.
210
+ * 1. Show the overflow in Edge.
211
+ */
212
+
213
+ button,
214
+ input {
215
+ /* 1 */
216
+ overflow: visible;
217
+ }
218
+
219
+ /**
220
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
221
+ * 1. Remove the inheritance of text transform in Firefox.
222
+ */
223
+
224
+ button,
225
+ select {
226
+ /* 1 */
227
+ text-transform: none;
228
+ }
229
+
230
+ /**
231
+ * Correct the inability to style clickable types in iOS and Safari.
232
+ */
233
+
234
+ button,
235
+ [type='button'],
236
+ [type='reset'],
237
+ [type='submit'] {
238
+ -webkit-appearance: button;
239
+ }
240
+
241
+ /**
242
+ * Remove the inner border and padding in Firefox.
243
+ */
244
+
245
+ button::-moz-focus-inner,
246
+ [type='button']::-moz-focus-inner,
247
+ [type='reset']::-moz-focus-inner,
248
+ [type='submit']::-moz-focus-inner {
249
+ border-style: none;
250
+ padding: 0;
251
+ }
252
+
253
+ /**
254
+ * Restore the focus styles unset by the previous rule.
255
+ */
256
+
257
+ button:-moz-focusring,
258
+ [type='button']:-moz-focusring,
259
+ [type='reset']:-moz-focusring,
260
+ [type='submit']:-moz-focusring {
261
+ outline: 1px dotted ButtonText;
262
+ }
263
+
264
+ /**
265
+ * Correct the padding in Firefox.
266
+ */
267
+
268
+ fieldset {
269
+ padding: 0.35em 0.75em 0.625em;
270
+ }
271
+
272
+ /**
273
+ * 1. Correct the text wrapping in Edge and IE.
274
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
275
+ * 3. Remove the padding so developers are not caught out when they zero out
276
+ * `fieldset` elements in all browsers.
277
+ */
278
+
279
+ legend {
280
+ box-sizing: border-box;
281
+ /* 1 */
282
+ color: inherit;
283
+ /* 2 */
284
+ display: table;
285
+ /* 1 */
286
+ max-width: 100%;
287
+ /* 1 */
288
+ padding: 0;
289
+ /* 3 */
290
+ white-space: normal;
291
+ /* 1 */
292
+ }
293
+
294
+ /**
295
+ * Add the correct vertical alignment in Chrome, Firefox, and Opera.
296
+ */
297
+
298
+ progress {
299
+ vertical-align: baseline;
300
+ }
301
+
302
+ /**
303
+ * Remove the default vertical scrollbar in IE 10+.
304
+ */
305
+
306
+ textarea {
307
+ overflow: auto;
308
+ }
309
+
310
+ /**
311
+ * 1. Add the correct box sizing in IE 10.
312
+ * 2. Remove the padding in IE 10.
313
+ */
314
+
315
+ [type='checkbox'],
316
+ [type='radio'] {
317
+ box-sizing: border-box;
318
+ /* 1 */
319
+ padding: 0;
320
+ /* 2 */
321
+ }
322
+
323
+ /**
324
+ * Correct the cursor style of increment and decrement buttons in Chrome.
325
+ */
326
+
327
+ [type='number']::-webkit-inner-spin-button,
328
+ [type='number']::-webkit-outer-spin-button {
329
+ height: auto;
330
+ }
331
+
332
+ /**
333
+ * 1. Correct the odd appearance in Chrome and Safari.
334
+ * 2. Correct the outline style in Safari.
335
+ */
336
+
337
+ [type='search'] {
338
+ -webkit-appearance: textfield;
339
+ /* 1 */
340
+ outline-offset: -2px;
341
+ /* 2 */
342
+ }
343
+
344
+ /**
345
+ * Remove the inner padding in Chrome and Safari on macOS.
346
+ */
347
+
348
+ [type='search']::-webkit-search-decoration {
349
+ -webkit-appearance: none;
350
+ }
351
+
352
+ /**
353
+ * 1. Correct the inability to style clickable types in iOS and Safari.
354
+ * 2. Change font properties to `inherit` in Safari.
355
+ */
356
+
357
+ ::-webkit-file-upload-button {
358
+ -webkit-appearance: button;
359
+ /* 1 */
360
+ font: inherit;
361
+ /* 2 */
362
+ }
363
+
364
+ /* Interactive
365
+ ========================================================================== */
366
+
367
+ /*
368
+ * Add the correct display in Edge, IE 10+, and Firefox.
369
+ */
370
+
371
+ details {
372
+ display: block;
373
+ }
374
+
375
+ /*
376
+ * Add the correct display in all browsers.
377
+ */
378
+
379
+ summary {
380
+ display: list-item;
381
+ }
382
+
383
+ /* Misc
384
+ ========================================================================== */
385
+
386
+ /**
387
+ * Add the correct display in IE 10+.
388
+ */
389
+
390
+ template {
391
+ display: none;
392
+ }
393
+
394
+ /**
395
+ * Add the correct display in IE 10.
396
+ */
397
+
398
+ [hidden] {
399
+ display: none;
400
+ }
401
+ }
@@ -0,0 +1,16 @@
1
+ @mixin scrollbars($size: 10px, $foreground-color: black, $background-color: gray) {
2
+ // For Chrome & Safari
3
+ &::-webkit-scrollbar {
4
+ width: $size;
5
+ height: $size;
6
+ }
7
+ &::-webkit-scrollbar-thumb {
8
+ background-color: $foreground-color;
9
+ }
10
+ &::-webkit-scrollbar-track {
11
+ background-color: $background-color;
12
+ }
13
+
14
+ // Standard version (Firefox only for now)
15
+ scrollbar-color: $foreground-color $background-color;
16
+ }
@@ -0,0 +1,8 @@
1
+ @mixin svg-auto-color {
2
+ [fill]:not([fill='none']) {
3
+ fill: currentColor;
4
+ }
5
+ [stroke]:not([stroke='none']) {
6
+ stroke: currentColor;
7
+ }
8
+ }