@microphi/styles 1.2.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # 1.2.0 (2024-11-15)
7
+
8
+ ### Features
9
+
10
+ * **styles:** fix deprecation warnings ([4fba924](https://example.com/commits/4fba924c5bcbfa9e4019cdfee33019e16561fbff))
11
+
12
+ # [1.1.0](/compare/v0.2.10...v1.1.0) (2023-01-16)
13
+
14
+ **Note:** Version bump only for package @microphi/styles
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # fx-scss
2
+
3
+ Welcome to the **fx-scss**, a flex first set of css classes to ease
4
+
5
+ ## Motivations
6
+ While working on Microgamma we went through all available scss libraries. All lacked a flex first approach to layouting.
7
+ We believe in a flex first approach when it comes to layouting. This library is the result of our though process in term of layouting and utilities.
8
+
9
+
10
+ ## Table of Contents
11
+
12
+ - [Features](#features)
13
+ - [Installation](#installation)
14
+ - [Getting Started](#getting-started)
15
+ - [Folder Structure](#folder-structure)
16
+ - [Customization](#customization)
17
+ - [Contributing](#contributing)
18
+ - [License](#license)
19
+
20
+ ## Features
21
+
22
+ - **Modular Architecture:** A well-organized structure with reusable components and utilities.
23
+ - **Flex layout system:** Flex layout system for clear and powerful layouting.
24
+ - **Utility Classes:** Commonly used utility classes for margin, padding, colors, typography, etc.
25
+ # - **Mixins and Functions:** Custom mixins and functions to reduce repetitive CSS and enhance your workflow.
26
+ # - **Theming Support:** Easy customization of themes through variables for colors, typography, and other design elements.
27
+ - **Compatibility:** Fully compatible with modern browsers and responsive across all device sizes.
28
+
29
+ ## Installation
30
+
31
+ Install using your favorite package manager
32
+
33
+ ```bash
34
+ @microphi/flexus
35
+ ```
36
+
37
+ Alternatively, you can manually download the SCSS files and include them in your project.
38
+
39
+ ## Getting Started
40
+
41
+ library_name is made of the following scss modules
42
+
43
+
44
+ ```scss
45
+ @import 'path/to/scss-library/main.scss';
46
+ ```
47
+
48
+ This will include the core styles and utilities in your project. You can then start building your styles on top of the provided components.
49
+
50
+ ### Example Usage
51
+
52
+ Here's a basic example using the grid system and utility classes:
53
+
54
+ ```html
55
+ <div class="container">
56
+ <div class="row">
57
+ <div class="col-6">
58
+ <p class="text-primary">This is a column</p>
59
+ </div>
60
+ <div class="col-6">
61
+ <p class="text-secondary">This is another column</p>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ ```
66
+
67
+ ## Folder Structure
68
+
69
+ The SCSS library follows a clean, modular structure:
70
+
71
+ ```
72
+ scss-library/
73
+ │
74
+ ├── base/ # Base styles (normalize, resets, typography, etc.)
75
+ ├── components/ # Reusable components (buttons, cards, forms, etc.)
76
+ ├── layout/ # Layout helpers (grid, containers, spacing, etc.)
77
+ ├── mixins/ # Utility mixins (media queries, typography helpers, etc.)
78
+ ├── themes/ # Theming (color palettes, variables, dark/light modes)
79
+ └── utilities/ # Utility classes (margin, padding, display, etc.)
80
+ ```
81
+
82
+ ### Key Files
83
+
84
+ - `main.scss`: The primary file to import into your project.
85
+ - `variables.scss`: Defines default variables for colors, typography, spacing, etc.
86
+ - `mixins.scss`: Contains mixins to simplify responsive design, typography, and other features.
87
+
88
+ ## Customization
89
+
90
+ The library is designed to be easily customizable. You can override the default variables by creating your own SCSS file and importing the library below your custom settings:
91
+
92
+ ```scss
93
+ // Custom variables
94
+ $primary-color: #007bff;
95
+ $secondary-color: #6c757d;
96
+
97
+ // Import library after customizations
98
+ @import 'path/to/scss-library/main.scss';
99
+ ```
100
+
101
+ ### Theming
102
+
103
+ To create a custom theme, simply modify the variables in the `themes/` folder or define new ones in your project. You can switch between themes dynamically by overriding these variables.
104
+
105
+ ## Contributing
106
+
107
+ We welcome contributions to improve the library! To contribute, please follow these steps:
108
+
109
+ 1. Fork the repository.
110
+ 2. Create a new branch for your feature or bug fix.
111
+ 3. Make your changes and ensure all SCSS is properly compiled.
112
+ 4. Submit a pull request with a detailed explanation of your changes.
113
+
114
+ Please follow the [contribution guidelines](CONTRIBUTING.md) for more details.
115
+
116
+ ## License
117
+
118
+ This SCSS library is open-source and available under the [MIT License](LICENSE).
119
+
120
+ ---
121
+
122
+ Feel free to open an issue if you have any questions or run into any issues while using the library. Happy coding!
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@microphi/styles",
3
+ "version": "1.2.0",
4
+ "description": "helper styles",
5
+ "scripts": {},
6
+ "private": false,
7
+ "repository": {
8
+ "type": "git",
9
+ "url": " "
10
+ },
11
+ "keywords": [
12
+ "styles",
13
+ "css",
14
+ "scss",
15
+ "helpers"
16
+ ],
17
+ "author": "cavaliere.davide@gmail.com",
18
+ "license": "ISC",
19
+ "devDependencies": {
20
+ "utopia-core-scss": "*"
21
+ },
22
+ "peerDependencies": {
23
+ "utopia-core-scss": "^1.2.0"
24
+ }
25
+ }
@@ -0,0 +1,23 @@
1
+ @import "variables";
2
+ @import "mixins";
3
+
4
+ $radius-map: (
5
+ "border-radius": (
6
+ property: border-radius,
7
+ shortcut: rounded,
8
+ values: (
9
+ none: 0px,
10
+ sm: $space-base * 0.125,
11
+ base: $space-base * 0.25,
12
+ lg: $space-base * 0.5,
13
+ xl: $space-base * 0.75,
14
+ 2xl: $space-base * 1,
15
+ 3xl: $space-base * 1.5,
16
+ full: 9999px
17
+ )
18
+ ),
19
+ );
20
+
21
+ @each $key, $utility in $radius-map {
22
+ @include generate-utilities($utility)
23
+ }
@@ -0,0 +1,28 @@
1
+ @use "variables" as v;
2
+ @use "mixins" as m;
3
+
4
+ $display-map: (
5
+ "display": (
6
+ property: display,
7
+ shortcut: null,
8
+ values: (block, inline-block, inline, flex, inline-flex)
9
+ ),
10
+ "overflow": (
11
+ property: overflow,
12
+ shortcut: 'overflow',
13
+ values: (hidden, auto)
14
+ )
15
+ );
16
+
17
+ @each $key, $utility in $display-map {
18
+ @include m.generate-utilities($utility)
19
+ }
20
+
21
+
22
+ .#{v.$prefix}-hidden {
23
+ display: none;
24
+ }
25
+
26
+ @include m.generate-mq(#{v.$prefix}-hidden) {
27
+ display: none !important;
28
+ }
@@ -0,0 +1,74 @@
1
+ @use "variables" as var;
2
+ @use "mixins" as mix;
3
+
4
+ // Flex utilities map
5
+ $flex-map: (
6
+ "flex": (
7
+ property: flex,
8
+ values: (
9
+ 1: 1 0 0,
10
+ auto: 1 1 auto,
11
+ initial: 0 1 auto,
12
+ none: none,
13
+ )
14
+ ),
15
+ "flex-direction": (
16
+ property: flex-direction,
17
+ shortcut: flex,
18
+ values: (
19
+ row: row,
20
+ row-reverse: row-reverse,
21
+ col: column,
22
+ col-reverse: column-reverse
23
+ )
24
+ ),
25
+ "flex-wrap": (
26
+ property: flex-wrap,
27
+ shortcut: flex,
28
+ values: (wrap, wrap-reverse, nowrap)
29
+ ),
30
+ "flex-grow": (
31
+ property: flex-grow,
32
+ shortcut: grow,
33
+ values: (1, 0)
34
+ ),
35
+ "flex-shrink": (
36
+ property: flex-shrink,
37
+ shortcut: shrink,
38
+ values: (1, 0)
39
+ ),
40
+ "justify-content": (
41
+ property: justify-content,
42
+ shortcut: justify,
43
+ values: (
44
+ normal: normal,
45
+ start: flex-start,
46
+ end: flex-end,
47
+ center: center,
48
+ between: space-between,
49
+ around: space-around,
50
+ evenly: space-evenly,
51
+ stretch: stretch
52
+ )
53
+ ),
54
+ "align-items": (
55
+ property: align-items,
56
+ shortcut: items,
57
+ values: (
58
+ start: flex-start,
59
+ end: flex-end,
60
+ center: center,
61
+ baseline: baseline,
62
+ stretch: stretch
63
+ )
64
+ ),
65
+ "gap": (
66
+ property: gap,
67
+ shortcut: gap,
68
+ values: var.$values
69
+ ),
70
+ );
71
+
72
+ @each $key, $utility in $flex-map {
73
+ @include mix.generate-utilities($utility)
74
+ }
@@ -0,0 +1,259 @@
1
+ // flex utilities
2
+ .fx-flex {
3
+ display: flex;
4
+ }
5
+
6
+ .fx-flex-fill {
7
+ width: 100%;
8
+ height: 100%;
9
+ }
10
+
11
+ .fx-fill-column {
12
+ height: 100%;
13
+ }
14
+
15
+ .fx-fill-row {
16
+ width: 100%;
17
+ }
18
+
19
+ .fx-flex-grow {
20
+ flex-grow: 1;
21
+ }
22
+
23
+ @mixin styles($prefix: '') {
24
+ $actual-prefix: if($prefix == '', '', #{$prefix}--);
25
+
26
+ .#{$actual-prefix}hidden {
27
+ display: none !important;
28
+ }
29
+
30
+ .#{$actual-prefix}fx-flex-column {
31
+ display: flex;
32
+ flex-direction: column;
33
+ }
34
+
35
+ .#{$actual-prefix}fx-flex-row {
36
+ display: flex;
37
+ flex-direction: row;
38
+ }
39
+
40
+ .#{$actual-prefix}fx-flex-nowrap {
41
+ flex-wrap: nowrap;
42
+ }
43
+
44
+ .#{$actual-prefix}fx-flex-wrap {
45
+ flex-wrap: wrap;
46
+ }
47
+
48
+ .#{$actual-prefix}fx-flex-align-items-center {
49
+ align-items: center;
50
+ }
51
+
52
+ .#{$actual-prefix}fx-flex-align-items-baseline {
53
+ align-items: baseline;
54
+ }
55
+
56
+ .#{$actual-prefix}fx-flex-justify-center {
57
+ justify-content: center;
58
+ }
59
+
60
+ .#{$actual-prefix}fx-flex-align-items-start {
61
+ align-items: flex-start;
62
+ }
63
+
64
+ .#{$actual-prefix}fx-flex-align-items-end {
65
+ align-items: flex-end;
66
+ }
67
+
68
+ .#{$actual-prefix}fx-flex-align-items-baseline {
69
+ align-items: baseline;
70
+ }
71
+
72
+ .#{$actual-prefix}fx-flex-align-center-center {
73
+ align-items: center;
74
+ justify-content: center;
75
+ }
76
+
77
+ .#{$actual-prefix}fx-flex-justify-space-evenly {
78
+ justify-content: space-around;
79
+ }
80
+
81
+ .#{$actual-prefix}fx-flex-justify-space-around {
82
+ justify-content: space-around;
83
+ }
84
+
85
+ .#{$actual-prefix}fx-flex-justify-space-between {
86
+ justify-content: space-between;
87
+ }
88
+
89
+ .#{$actual-prefix}fx-flex-justify-end {
90
+ justify-content: end;
91
+ }
92
+
93
+
94
+ $i: 0;
95
+ @while $i <= 100 {
96
+
97
+ .#{$actual-prefix}fx-w-#{$i} {
98
+ width: #{$i}vw;
99
+ }
100
+
101
+ .#{$actual-prefix}fx-h-#{$i} {
102
+ height: #{$i}vh;
103
+ }
104
+
105
+
106
+ // do stuff
107
+ $i: $i + 10;
108
+ }
109
+
110
+ .#{$actual-prefix}fx-flex-grow {
111
+ flex-grow: 1;
112
+ }
113
+
114
+ $j: 0;
115
+
116
+ @while $j < 4 {
117
+
118
+ .#{$actual-prefix}fx-flex-grow-#{$j} {
119
+ flex-grow: $j;
120
+ }
121
+
122
+ $j: $j + 1;
123
+
124
+ }
125
+ }
126
+
127
+ @include styles();
128
+
129
+ @media (min-aspect-ratio: 4/4) {
130
+ /* Styles for wide screens */
131
+ @include styles('wider');
132
+
133
+ }
134
+
135
+ @media (min-aspect-ratio: 5/4) {
136
+ /* Styles for very wide screens */
137
+ @include styles('very-wide');
138
+ }
139
+
140
+
141
+ @media (max-aspect-ratio: 4/4) {
142
+ /* Styles for tall screens */
143
+ @include styles('taller');
144
+ }
145
+
146
+ $breakpoints : (
147
+ '': null,
148
+ 'xs-': 400,
149
+ 'sm-': 750,
150
+ 'md-': 900,
151
+ 'lg-': 1200,
152
+ 'xlg-': 1450,
153
+ ) !default;
154
+
155
+ @each $media-shortcut, $max-width in $breakpoints {
156
+
157
+ @if $max-width != null {
158
+ @media (max-width: #{$max-width}px) {
159
+
160
+ .below-#{$media-shortcut} {
161
+
162
+ &-hidden {
163
+ display: none !important;
164
+ }
165
+
166
+ &-fx-flex-row {
167
+ display: flex;
168
+ flex-direction: row;
169
+ }
170
+
171
+ &-fx-flex-row-reverse {
172
+ display: flex;
173
+ flex-direction: row-reverse;
174
+ }
175
+
176
+ &-fx-flex-column {
177
+ display: flex;
178
+ flex-direction: column;
179
+ }
180
+
181
+ &-fx-flex-column-reverse {
182
+ display: flex;
183
+ flex-direction: column-reverse;
184
+ }
185
+
186
+ &-fx-flex-grow {
187
+ flex-grow: 1;
188
+ }
189
+ }
190
+ }
191
+
192
+ @media (min-width: #{$max-width}px) {
193
+
194
+ .above-#{$media-shortcut} {
195
+
196
+ &-hidden {
197
+ display: none !important;
198
+ }
199
+
200
+
201
+ &-fx-flex-column {
202
+ display: flex;
203
+ flex-direction: column;
204
+ }
205
+
206
+ &-fx-flex-row {
207
+ display: flex;
208
+ flex-direction: row;
209
+ }
210
+
211
+ &-fx-flex-grow {
212
+ flex-grow: 1;
213
+ }
214
+ }
215
+
216
+ }
217
+
218
+ }
219
+
220
+
221
+ // hidden utilities
222
+ @media (max-width: #{$max-width}px) {
223
+ .#{$media-shortcut}-hidden {
224
+ display: none !important;
225
+ }
226
+ }
227
+
228
+ }
229
+
230
+ /// end fx-flex helpers.... refactor every thing below this
231
+
232
+ .overflow-auto {
233
+ overflow: auto;
234
+ }
235
+
236
+ .overflow-hidden {
237
+ overflow: hidden;
238
+ }
239
+
240
+
241
+ .w-0 {
242
+ width: 0;
243
+ }
244
+
245
+ .h-0 {
246
+ width: 0;
247
+ }
248
+
249
+ .fx-fill-height {
250
+ height: calc(100vh - 2*var(--mat-toolbar-standard-height, 65px));
251
+ }
252
+
253
+ .fx-flex-000 {
254
+ flex: 0 0 0;
255
+ }
256
+
257
+ .fx-flex-100 {
258
+ flex: 1 0 0;
259
+ }
@@ -0,0 +1,32 @@
1
+ @use "sass:math";
2
+
3
+ $i: 100;
4
+
5
+ @while $i < 700 {
6
+
7
+
8
+ .fx-f-#{$i} {
9
+ font-weight: $i;
10
+ }
11
+
12
+ // do stuff
13
+ $i: $i + 100;
14
+ }
15
+
16
+
17
+ $j: 1;
18
+
19
+
20
+ .text-ellipsis {
21
+ text-overflow: ellipsis;
22
+ white-space: nowrap;
23
+ overflow: hidden;
24
+ }
25
+
26
+ .no-margin {
27
+ margin: 0 !important;
28
+ }
29
+
30
+ .fx-f-capitalize {
31
+ text-transform: capitalize;
32
+ }
@@ -0,0 +1,33 @@
1
+
2
+ .phi-pad {
3
+ padding: 4vh 12vw
4
+ }
5
+
6
+ .phi-pad-h {
7
+ padding: 4vh 0;
8
+ }
9
+
10
+ .phi-pad-v {
11
+ padding: 0 12vw;
12
+ }
13
+
14
+ .phi-as-pointer {
15
+ cursor: pointer;
16
+ }
17
+
18
+ .phi-backdrop-fixed {
19
+ background-attachment: fixed;
20
+ }
21
+
22
+ .phi-background {
23
+ background-repeat: no-repeat;
24
+ background-position: center center;
25
+ }
26
+
27
+ .phi-background-image-contain {
28
+ background-size: contain;
29
+ }
30
+
31
+ .phi-background-image-cover {
32
+ background-size: cover;
33
+ }
@@ -0,0 +1,47 @@
1
+ @use "variables" as v;
2
+ @use "sass:map";
3
+ @use "sass:list";
4
+ @use "sass:meta";
5
+
6
+ @mixin generate-utilities($utility) {
7
+ $values: map.get($utility, values);
8
+ $properties: map.get($utility, property);
9
+
10
+ // Use shortcut if present
11
+ $property-shortcut: if(map.has-key($utility, shortcut), map.get($utility, shortcut), list.nth($properties, 1));
12
+ $property-shortcut: if($property-shortcut == null, "", $property-shortcut);
13
+
14
+ // If the values are a list or string, convert it into a map
15
+ @if meta.type-of($values) == "string" or meta.type-of(list.nth($values, 1)) != "list" {
16
+ $values: list.zip($values, $values);
17
+ }
18
+
19
+ @each $key, $value in $values {
20
+ // Remove property in selector name if shortcut is null
21
+ $selector: if($property-shortcut == '', #{v.$prefix}-#{$key}, #{v.$prefix}-#{$property-shortcut}-#{$key});
22
+
23
+ .#{$selector} {
24
+ @each $property in $properties {
25
+ #{$property}: #{$value};
26
+ }
27
+ }
28
+
29
+ @include generate-mq($selector) {
30
+ @each $property in $properties {
31
+ #{$property}: #{$value} !important;
32
+ }
33
+ }
34
+ }
35
+ }
36
+
37
+ // Generate media queries classes
38
+ // e.g. .md:fx-flex or .xl:fx-inline-flex
39
+ @mixin generate-mq($selector, $breakpoints: v.$breakpoints) {
40
+ @each $breakpoint, $width in $breakpoints {
41
+ @media (min-width: #{$width}px) {
42
+ .#{$breakpoint}\:#{$selector} {
43
+ @content;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,72 @@
1
+ @use "mixins" as mix;
2
+
3
+ $sizing-map: (
4
+ "width": (
5
+ property: width,
6
+ shortcut: w,
7
+ values: (
8
+ 0: 0,
9
+ 25: 25%,
10
+ 50: 50%,
11
+ 75: 75%,
12
+ full: 100%,
13
+ auto: auto
14
+ )
15
+ ),
16
+ "viewport-width": (
17
+ property: width,
18
+ shortcut: vw,
19
+ values: (
20
+ 10: 10vw,
21
+ 25: 25vw,
22
+ 33: 33vw,
23
+ 40: 40vw,
24
+ 50: 50vw,
25
+ 60: 60vw,
26
+ 66: 66vw,
27
+ 75: 75vw,
28
+ full: 100vw
29
+ )
30
+ ),
31
+ "height": (
32
+ property: height,
33
+ shortcut: h,
34
+ values: (
35
+ 0: 0,
36
+ 25: 25%,
37
+ 50: 50%,
38
+ 75: 75%,
39
+ full: 100%,
40
+ auto: auto
41
+ )
42
+ ),
43
+ "viewport-height": (
44
+ property: height,
45
+ shortcut: vh,
46
+ values: (
47
+ 10: 10vh,
48
+ 25: 25vh,
49
+ 33: 33vh,
50
+ 40: 40vh,
51
+ 50: 50vh,
52
+ 60: 60vh,
53
+ 66: 66vh,
54
+ 75: 75vh,
55
+ full: 100vh
56
+ )
57
+ ),
58
+ "size": (
59
+ property: (width, height),
60
+ shortcut: size,
61
+ values: (
62
+ 1\/4: 25%,
63
+ 2\/4: 50%,
64
+ 3\/4: 75%,
65
+ full: 100%
66
+ )
67
+ ),
68
+ );
69
+
70
+ @each $key, $utility in $sizing-map {
71
+ @include mix.generate-utilities($utility)
72
+ }
@@ -0,0 +1,82 @@
1
+ @use "sass:map";
2
+
3
+ @use "variables" as var;
4
+ @use "mixins" as mix;
5
+
6
+
7
+ $spacing-map: (
8
+ "margin": (
9
+ property: margin,
10
+ shortcut: m,
11
+ values: var.$values
12
+ ),
13
+ "margin-top": (
14
+ property: margin-top,
15
+ shortcut: mt,
16
+ values: var.$values
17
+ ),
18
+ "margin-right": (
19
+ property: margin-right,
20
+ shortcut: mr,
21
+ values: var.$values
22
+ ),
23
+ "margin-bottom": (
24
+ property: margin-bottom,
25
+ shortcut: mb,
26
+ values: var.$values
27
+ ),
28
+ "margin-left": (
29
+ property: margin-left,
30
+ shortcut: ml,
31
+ values: var.$values
32
+ ),
33
+ "margin-x": (
34
+ property: (margin-right, margin-left),
35
+ shortcut: mx,
36
+ values: var.$values
37
+ ),
38
+ "margin-y": (
39
+ property: (margin-top, margin-bottom),
40
+ shortcut: my,
41
+ values: var.$values
42
+ ),
43
+ "padding": (
44
+ property: padding,
45
+ shortcut: p,
46
+ values: map.deep-remove(var.$values, "a")
47
+ ),
48
+ "padding-top": (
49
+ property: padding-top,
50
+ shortcut: pt,
51
+ values: map.deep-remove(var.$values, "a")
52
+ ),
53
+ "padding-right": (
54
+ property: padding-right,
55
+ shortcut: pr,
56
+ values: map.deep-remove(var.$values, "a")
57
+ ),
58
+ "padding-bottom": (
59
+ property: padding-bottom,
60
+ shortcut: pb,
61
+ values: map.deep-remove(var.$values, "a")
62
+ ),
63
+ "padding-left": (
64
+ property: padding-left,
65
+ shortcut: pl,
66
+ values: map.deep-remove(var.$values, "a")
67
+ ),
68
+ "padding-x": (
69
+ property: (padding-right, padding-left),
70
+ shortcut: px,
71
+ values: map.deep-remove(var.$values, "a")
72
+ ),
73
+ "padding-y": (
74
+ property: (padding-top, padding-bottom),
75
+ shortcut: py,
76
+ values: map.deep-remove(var.$values, "a")
77
+ ),
78
+ );
79
+
80
+ @each $key, $utility in $spacing-map {
81
+ @include mix.generate-utilities($utility)
82
+ }
@@ -0,0 +1,121 @@
1
+ $space-xxs: 2px;
2
+ $space-xs: 4px;
3
+ $space-sm: 8px;
4
+ $space-md: 12px;
5
+ $space-lg: 16px;
6
+ $space-xl: 24px;
7
+ $space-xxl: 32px;
8
+ $space-auto: auto;
9
+
10
+ $spacing-shortcuts: (
11
+ "margin": "m",
12
+ "padding": "p"
13
+ ) !default;
14
+ $spacing-directions: ("top": "t", "right": "r", "bottom": "b", "left": "l") !default;
15
+ $spacing-horizontal: "x" !default;
16
+ $spacing-vertical: "y" !default;
17
+ $spacing-values: (
18
+ "0": 0,
19
+ "1": $space-xxs,
20
+ "2": $space-xs,
21
+ "3": $space-sm,
22
+ "4": $space-md,
23
+ "5": $space-lg,
24
+ "6": $space-xl,
25
+ "7": $space-xxl,
26
+ "8": 64px,
27
+ "9": 128px,
28
+ "a": $space-auto,
29
+ ) !default;
30
+
31
+ $breakpoints : (
32
+ '': null,
33
+ 'xs-': 400,
34
+ 'sm-': 750,
35
+ 'md-': 850,
36
+ 'lg-': 1200,
37
+ 'xlg-': 1450,
38
+ ) !default;
39
+
40
+ @each $media-shortcut, $width in $breakpoints {
41
+ @if $width == null {
42
+ @each $property, $shortcut in $spacing-shortcuts {
43
+ @each $name, $value in $spacing-values {
44
+
45
+
46
+
47
+ // such as: m-3 or p-4
48
+ .#{$shortcut}-#{$name} {
49
+ #{$property}: $value
50
+ }
51
+
52
+ .gap-#{$name} {
53
+ gap: $value;
54
+ }
55
+
56
+ @each $direction, $suffix in $spacing-directions {
57
+ // such as: mr-3 or pb-4
58
+ .#{$shortcut}#{$suffix}-#{$name} {
59
+ #{$property}-#{$direction}: $value;
60
+ }
61
+
62
+ }
63
+
64
+ @if $spacing-horizontal != null {
65
+ .#{$shortcut}#{$spacing-horizontal}-#{$name} {
66
+ #{$property}-left: $value;
67
+ #{$property}-right: $value;
68
+ }
69
+
70
+ }
71
+
72
+ @if $spacing-vertical != null {
73
+ .#{$shortcut}#{$spacing-vertical}-#{$name} {
74
+ #{$property}-top: $value;
75
+ #{$property}-bottom: $value;
76
+ }
77
+
78
+ }
79
+
80
+ }
81
+ }
82
+ }
83
+
84
+ //@debug "media-shortcut: #{$media-shortcut}";
85
+
86
+ @media (max-width: #{$width}px) {
87
+ //@debug "";
88
+ @each $property, $shortcut in $spacing-shortcuts {
89
+ @each $name, $value in $spacing-values {
90
+
91
+ //@debug "rule: .#{$media-shortcut}-#{$shortcut}-#{$name}";
92
+
93
+ .#{$media-shortcut}-#{$shortcut}-#{$name} {
94
+ #{$property}: $value
95
+ }
96
+
97
+ @each $direction, $suffix in $spacing-directions {
98
+ .#{$media-shortcut}-#{$shortcut}#{$suffix}-#{$name} {
99
+ #{$property}-#{$direction}: $value;
100
+ }
101
+ }
102
+
103
+ @if $spacing-horizontal != null {
104
+ .#{$media-shortcut}-#{$shortcut}#{$spacing-horizontal}-#{$name} {
105
+ #{$property}-left: $value;
106
+ #{$property}-right: $value;
107
+ }
108
+ }
109
+
110
+ @if $spacing-vertical != null {
111
+ .#{$media-shortcut}-#{$shortcut}#{$spacing-vertical}-#{$name} {
112
+ #{$property}-top: $value;
113
+ #{$property}-bottom: $value;
114
+ }
115
+ }
116
+
117
+ }
118
+ }
119
+
120
+ }
121
+ }
@@ -0,0 +1,100 @@
1
+ @use 'sass:math';
2
+ @use "sass:map";
3
+
4
+ $font-weight-map: (
5
+ font-thin: 100,
6
+ font-extralight: 200,
7
+ font-light: 300,
8
+ font-normal: 400,
9
+ font-medium: 500,
10
+ font-semibold: 600,
11
+ font-bold: 700,
12
+ font-extrabold: 800,
13
+ font-black: 900
14
+ ) !default;
15
+
16
+
17
+ @each $key, $value in $font-weight-map {
18
+ .fx-#{$key} {
19
+ font-weight: #{$value};
20
+ }
21
+ }
22
+
23
+
24
+ @function project($min, $max) {
25
+ $r_min: 400px;
26
+ $r_max: 1000px;
27
+
28
+ $m: calc(($max - $min)/($r_max - $r_min) * 100);
29
+ @return clamp($min, min(#{$m}vw, #{$m}vh), $max);
30
+ }
31
+
32
+ // TODO: Check the line-height for headlines and subtitles
33
+ .fx-headline-1 {
34
+ font-size: var(--fx-typography-6);
35
+ /* font-size: project(60px, 112px); */
36
+ font-weight: map.get($font-weight-map, font-semibold);
37
+ line-height: initial;
38
+ }
39
+
40
+ .fx-headline-2 {
41
+ font-size: var(--fx-typography-5);
42
+ /* font-size: project(40px, 84px); */
43
+ font-weight: map.get($font-weight-map, font-medium);
44
+ line-height: initial;
45
+ }
46
+
47
+ .fx-headline-3 {
48
+ font-size: var(--fx-typography-4);
49
+ /* font-size: project(30px, 64px); */
50
+ font-weight: map.get($font-weight-map, font-semibold);
51
+ line-height: initial;
52
+ }
53
+
54
+ .fx-headline-4 {
55
+ font-size: var(--fx-typography-3);
56
+ font-weight: map.get($font-weight-map, font-semibold);
57
+ line-height: initial;
58
+ }
59
+
60
+ .fx-headline-5 {
61
+ font-size: var(--fx-typography-3);
62
+ font-weight: map.get($font-weight-map, font-normal);
63
+ line-height: initial;
64
+ }
65
+
66
+ .fx-title {
67
+ font-size: var(--fx-typography-2);
68
+ font-weight: map.get($font-weight-map, font-medium);
69
+ line-height: 1.6rem;
70
+ }
71
+
72
+ .fx-subtitle {
73
+ font-size: var(--fx-typography-1);
74
+ font-weight: map.get($font-weight-map, font-normal);
75
+ line-height: 1.6rem;
76
+ }
77
+
78
+ .fx-body-1 {
79
+ font-size: var(--fx-typography-0);
80
+ font-weight: map.get($font-weight-map, font-normal);
81
+ line-height: 1.5rem;
82
+ }
83
+
84
+ .fx-body-2 {
85
+ font-size: var(--fx-typography--1);
86
+ font-weight: map.get($font-weight-map, font-light);
87
+ line-height: var(--fx-typography-1);
88
+ }
89
+
90
+ .fx-caption {
91
+ font-size: var(--fx-typography--2);
92
+ font-weight: map.get($font-weight-map, font-normal);
93
+ line-height: initial;
94
+ }
95
+
96
+ .fx-overline {
97
+ font-size: var(--fx-typography--3);
98
+ font-weight: map.get($font-weight-map, font-light);
99
+ line-height: initial;
100
+ }
@@ -0,0 +1,57 @@
1
+ $prefix: fx !default;
2
+
3
+ $space-base: 16px !default;
4
+ $space-auto: "auto" !default;
5
+
6
+ $_spacing-values: (
7
+ "0": 0,
8
+ "1": $space-base * 0.25,
9
+ "2": $space-base * 0.5,
10
+ "3": $space-base * 0.75,
11
+ "4": $space-base,
12
+ "5": $space-base * 1.25,
13
+ "6": $space-base * 1.5,
14
+ "7": $space-base * 1.75,
15
+ "8": $space-base * 2,
16
+ "9": $space-base * 2.25,
17
+ "10": $space-base * 2.5,
18
+ "11": $space-base * 2.75,
19
+ "12": $space-base * 3,
20
+ "14": $space-base * 3.5,
21
+ "16": $space-base * 4,
22
+ "20": $space-base * 5,
23
+ "24": $space-base * 6,
24
+ "28": $space-base * 7,
25
+ "32": $space-base * 8,
26
+ "a": $space-auto,
27
+ ) !default;
28
+
29
+
30
+ $values: (
31
+ "0": 0,
32
+ "1": var(--fx-xs),
33
+ "2": var(--fx-2xs),
34
+ "3": var(--fx-3xs),
35
+ "4": var(--fx-s),
36
+ "5": var(--fx-m),
37
+ "6": var(--fx-l),
38
+ "7": var(--fx-xl),
39
+ "8": var(--fx-2xl),
40
+ "a": $space-auto,
41
+ ) !default;
42
+
43
+ $_breakpoints: (
44
+ 'sm': 640,
45
+ 'md': 768,
46
+ 'lg': 1024,
47
+ 'xl': 1280,
48
+ 'xxl': 1536
49
+ ) !default;
50
+
51
+ $breakpoints: (
52
+ 'sm': 640,
53
+ 'md': 768,
54
+ 'lg': 1024,
55
+ 'xl': 1280,
56
+ 'xxl': 1536
57
+ ) !default;