@avenirs-esr/avenirs-dsav 0.1.108 → 0.1.109
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 +1 -0
- package/dist/avenirs-dsav.css +1 -1
- package/package.json +1 -1
- package/src/styles/core/_spacing.scss +1 -5
- package/src/styles/core/_typography.scss +33 -15
- package/src/styles/main.scss +1 -2
- package/src/styles/mixins/_responsive-utility.scss +23 -0
- package/src/styles/utilities/_helpers.scss +0 -64
- package/src/styles/utilities/_layout.md +317 -0
- package/src/styles/utilities/_layout.scss +142 -0
- package/src/styles/utilities/_spacing.md +91 -0
- package/src/styles/utilities/_spacing.scss +16 -55
- package/src/styles/components/_grid.scss +0 -117
- package/src/styles/core/_accessibility.scss +0 -14
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
@use '../core/namespace' as *;
|
|
2
|
+
@use '../mixins/responsive-utility' as *;
|
|
3
|
+
@use '../settings/breakpoints' as bp;
|
|
4
|
+
@use '../core/spacing' as sp;
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
|
|
7
|
+
// === Containers ===
|
|
8
|
+
$container-paddings: (
|
|
9
|
+
sm: sm,
|
|
10
|
+
md: sm,
|
|
11
|
+
lg: md,
|
|
12
|
+
xl: md
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
// === Base container ===
|
|
16
|
+
// Ex: .av-container, .av-container-fluid
|
|
17
|
+
@include ns("container") {
|
|
18
|
+
max-width: 90rem;
|
|
19
|
+
margin-left: auto;
|
|
20
|
+
margin-right: auto;
|
|
21
|
+
padding-left: var(--spacing-sm);
|
|
22
|
+
padding-right: var(--spacing-sm);
|
|
23
|
+
|
|
24
|
+
&-fluid {
|
|
25
|
+
max-width: none;
|
|
26
|
+
padding-left: var(--spacing-none);
|
|
27
|
+
padding-right: var(--spacing-none);
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// === Responsive containers ===
|
|
33
|
+
// Ex: .av-container--md / .av-container--lg
|
|
34
|
+
@each $bp-name, $bp-value in bp.$breakpoints {
|
|
35
|
+
@media (min-width: #{$bp-value}) {
|
|
36
|
+
@include ns("container--#{$bp-name}") {
|
|
37
|
+
width: 100%;
|
|
38
|
+
max-width: #{$bp-value};
|
|
39
|
+
margin-left: auto;
|
|
40
|
+
margin-right: auto;
|
|
41
|
+
padding-left: var(--spacing-#{map.get($container-paddings, $bp-name)});
|
|
42
|
+
padding-right: var(--spacing-#{map.get($container-paddings, $bp-name)});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// === Rows ===
|
|
48
|
+
@include responsive-utility("row", (
|
|
49
|
+
display: flex,
|
|
50
|
+
flex-direction: row
|
|
51
|
+
));
|
|
52
|
+
|
|
53
|
+
// === Columns ===
|
|
54
|
+
@include responsive-utility("col", (
|
|
55
|
+
display: flex,
|
|
56
|
+
flex-direction: column
|
|
57
|
+
));
|
|
58
|
+
|
|
59
|
+
// === Flex wrap ===
|
|
60
|
+
@include responsive-utility("wrap", (
|
|
61
|
+
flex-wrap: wrap
|
|
62
|
+
));
|
|
63
|
+
@include responsive-utility("nowrap", (
|
|
64
|
+
flex-wrap: nowrap
|
|
65
|
+
));
|
|
66
|
+
|
|
67
|
+
// === Accessibility ===
|
|
68
|
+
// Ex: .av-sr-only / .av-sr-only--sm / .av-sr-only--md / .av-sr-only--lg / .av-sr-only--xl
|
|
69
|
+
@include responsive-utility("sr-only", (
|
|
70
|
+
position: absolute !important,
|
|
71
|
+
width: 1px !important,
|
|
72
|
+
height: 1px !important,
|
|
73
|
+
padding: 0 !important,
|
|
74
|
+
margin: -1px !important,
|
|
75
|
+
overflow: hidden !important,
|
|
76
|
+
clip: rect(0, 0, 0, 0) !important,
|
|
77
|
+
white-space: nowrap !important,
|
|
78
|
+
border: 0 !important
|
|
79
|
+
));
|
|
80
|
+
|
|
81
|
+
// === Visibility classes ===
|
|
82
|
+
// Ex: .av-hidden / .av-hidden--md / .av-unhidden / .av-unhidden--lg
|
|
83
|
+
@include responsive-utility("hidden", (
|
|
84
|
+
display: none !important
|
|
85
|
+
));
|
|
86
|
+
@include responsive-utility("unhidden", (
|
|
87
|
+
display: inherit !important
|
|
88
|
+
));
|
|
89
|
+
|
|
90
|
+
// === Gapped layouts ===
|
|
91
|
+
// Ex: .av-gap-sm / .av-gap-lg / .av-gap-lg--lg
|
|
92
|
+
@each $size, $value in sp.$spacing {
|
|
93
|
+
@include responsive-utility("gap-#{$size}", (
|
|
94
|
+
gap: var(--spacing-#{$size})
|
|
95
|
+
));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// === Flex fill class ===
|
|
99
|
+
// Ex: .av-flex-fill / .av-flex-fill--md
|
|
100
|
+
@include responsive-utility("flex-fill", (
|
|
101
|
+
flex: 1 1 0%
|
|
102
|
+
));
|
|
103
|
+
|
|
104
|
+
// === Full width/height classes ===
|
|
105
|
+
// Ex: .av-w-full / .av-h-full / .av-w-full--lg / .av-h-full--md
|
|
106
|
+
@include responsive-utility("w-full", (
|
|
107
|
+
width: 100%
|
|
108
|
+
));
|
|
109
|
+
@include responsive-utility("h-full", (
|
|
110
|
+
height: 100%
|
|
111
|
+
));
|
|
112
|
+
|
|
113
|
+
// === Flex alignment classes ===
|
|
114
|
+
// Ex: .av-align-center / .av-align-end / .av-align-baseline--lg
|
|
115
|
+
$alignments: (
|
|
116
|
+
start: flex-start,
|
|
117
|
+
center: center,
|
|
118
|
+
end: flex-end,
|
|
119
|
+
stretch: stretch,
|
|
120
|
+
baseline: baseline
|
|
121
|
+
);
|
|
122
|
+
@each $alignment, $value in $alignments {
|
|
123
|
+
@include responsive-utility("align-#{$alignment}", (
|
|
124
|
+
align-items: $value
|
|
125
|
+
));
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// === Flex justification classes ===
|
|
129
|
+
// Ex: .av-justify-center / .av-justify-between / .av-justify-end--md
|
|
130
|
+
$justifications: (
|
|
131
|
+
start: flex-start,
|
|
132
|
+
center: center,
|
|
133
|
+
end: flex-end,
|
|
134
|
+
between: space-between,
|
|
135
|
+
around: space-around,
|
|
136
|
+
evenly: space-evenly
|
|
137
|
+
);
|
|
138
|
+
@each $justification, $value in $justifications {
|
|
139
|
+
@include responsive-utility("justify-#{$justification}", (
|
|
140
|
+
justify-content: $value
|
|
141
|
+
));
|
|
142
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
layout: page
|
|
3
|
+
lastUpdated: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Spacing
|
|
7
|
+
|
|
8
|
+
## ✨ Introduction
|
|
9
|
+
|
|
10
|
+
This `spacing` utility generates margin and padding classes for all defined spacing sizes, both globally and directionally, with responsive variants.
|
|
11
|
+
|
|
12
|
+
## 🏷️ Class patterns
|
|
13
|
+
|
|
14
|
+
| Class pattern | Description | Responsive variants |
|
|
15
|
+
|---------------|-------------|---------------------|
|
|
16
|
+
| `.av-m{direction?}-{spacing}` | Applies `margin`; optional direction: `t` (`top`), `r` (`right`), `b` (`bottom`), `l` (`left`), `x` (`horizontal`), `y` (`vertical`) | `--sm`, `--md`, `--lg`, `--xl` |
|
|
17
|
+
| `.av-p{direction?}-{spacing}` | Applies `padding`; optional direction: `t` (`top`), `r` (`right`), `b` (`bottom`), `l` (`left`), `x` (`horizontal`), `y` (`vertical`) | `--sm`, `--md`, `--lg`, `--xl` |
|
|
18
|
+
|
|
19
|
+
📝 Notes:
|
|
20
|
+
- `{spacing}` corresponds to the spacing scale defined in the core: `none`, `xxxs`, `xxs`, `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `4xl`, `5xl`.
|
|
21
|
+
|
|
22
|
+
## 🎨 Some CSS results
|
|
23
|
+
|
|
24
|
+
### Global margin
|
|
25
|
+
|
|
26
|
+
```css
|
|
27
|
+
.av-m-sm {
|
|
28
|
+
margin: var(--spacing-sm) !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (min-width: 36rem) {
|
|
32
|
+
.av-m-sm--md {
|
|
33
|
+
margin: var(--spacing-sm) !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Directional margin
|
|
39
|
+
|
|
40
|
+
```css
|
|
41
|
+
.av-mt-sm {
|
|
42
|
+
margin-top: var(--spacing-sm) !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (min-width: 48rem) {
|
|
46
|
+
.av-my-lg--md {
|
|
47
|
+
margin-top: var(--spacing-lg) !important;
|
|
48
|
+
margin-bottom: var(--spacing-lg) !important;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Global padding
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
.av-p-md {
|
|
57
|
+
padding: var(--spacing-md) !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (min-width: 64rem) {
|
|
61
|
+
.av-p-md--lg {
|
|
62
|
+
padding: var(--spacing-md) !important;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Directional padding
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
.av-pb-lg--md {
|
|
71
|
+
padding-bottom: var(--spacing-lg) !important;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (min-width: 48rem) {
|
|
75
|
+
.av-px-lg--md {
|
|
76
|
+
padding-left: var(--spacing-lg) !important;
|
|
77
|
+
padding-right: var(--spacing-lg) !important;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 💡 Examples of use
|
|
83
|
+
|
|
84
|
+
```html
|
|
85
|
+
<div class="av-mt-md av-mb-lg--md av-px-sm av-py-xl--lg">
|
|
86
|
+
<!-- mt-md: top margin md on all screens -->
|
|
87
|
+
<!-- mb-lg--md: bottom margin lg on medium screens and up -->
|
|
88
|
+
<!-- px-sm: horizontal padding sm -->
|
|
89
|
+
<!-- py-xl--lg: vertical padding xl on large screens and up -->
|
|
90
|
+
</div>
|
|
91
|
+
```
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
@use '../core/spacing' as sp;
|
|
2
2
|
@use '../core/namespace' as *;
|
|
3
|
+
@use '../mixins/responsive-utility' as *;
|
|
3
4
|
@use '../settings/breakpoints' as bp;
|
|
4
5
|
@use "sass:meta";
|
|
5
6
|
|
|
@@ -18,71 +19,31 @@ $directions: (
|
|
|
18
19
|
y: (top, bottom),
|
|
19
20
|
);
|
|
20
21
|
|
|
21
|
-
// === Directional classes ===
|
|
22
|
-
// Ex : .av-mt-sm / .av-px-md
|
|
23
|
-
@each $type, $property-value in $properties {
|
|
24
|
-
@each $direction-key, $direction-value in $directions {
|
|
25
|
-
@each $size, $value in sp.$spacing {
|
|
26
|
-
@if meta.type-of($direction-value) == 'list' {
|
|
27
|
-
@include ns("#{$type}#{$direction-key}-#{$size}") {
|
|
28
|
-
@each $d in $direction-value {
|
|
29
|
-
#{$property-value}-#{$d}: var(--spacing-#{$size}) !important;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
} @else {
|
|
33
|
-
@include ns("#{$type}#{$direction-key}-#{$size}") {
|
|
34
|
-
#{$property-value}-#{$direction-value}: var(--spacing-#{$size}) !important;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
22
|
// === Global classes ===
|
|
42
|
-
// Ex : .av-m-sm / .av-p-md
|
|
23
|
+
// Ex : .av-m-sm / .av-p-md / .av-m-none--lg / .av-p-md--xl
|
|
43
24
|
@each $type, $property-value in $properties {
|
|
44
25
|
@each $size, $value in sp.$spacing {
|
|
45
|
-
@include
|
|
46
|
-
#{$property-value}: var(--spacing-#{$size}) !important
|
|
47
|
-
|
|
26
|
+
@include responsive-utility("#{$type}-#{$size}", (
|
|
27
|
+
#{$property-value}: var(--spacing-#{$size}) !important
|
|
28
|
+
));
|
|
48
29
|
}
|
|
49
30
|
}
|
|
50
31
|
|
|
51
|
-
// ===
|
|
52
|
-
// Ex : .av-mt-sm
|
|
32
|
+
// === Directional classes ===
|
|
33
|
+
// Ex : .av-mt-sm / .av-px-md / .av-mb-none--lg / .av-pt-md--xl
|
|
53
34
|
@each $type, $property-value in $properties {
|
|
54
35
|
@each $direction-key, $direction-value in $directions {
|
|
55
36
|
@each $size, $value in sp.$spacing {
|
|
56
|
-
@
|
|
57
|
-
@
|
|
58
|
-
@include
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
#{$property-value}-#{$d}: var(--spacing-#{$size}) !important;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
} @else {
|
|
66
|
-
@include ns("#{$type}#{$direction-key}-#{$size}--#{$breakpoint}") {
|
|
67
|
-
@include bp.min-width($breakpoint) {
|
|
68
|
-
#{$property-value}-#{$direction-value}: var(--spacing-#{$size}) !important;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// === Breakpoint-specific global classes ===
|
|
78
|
-
// Ex : .av-m-sm--lg / .av-p-md--xl / .av-m-none--lg
|
|
79
|
-
@each $type, $property-value in $properties {
|
|
80
|
-
@each $size, $value in sp.$spacing {
|
|
81
|
-
@each $breakpoint, $breakpoint-value in bp.$breakpoints {
|
|
82
|
-
@include ns("#{$type}-#{$size}--#{$breakpoint}") {
|
|
83
|
-
@include bp.min-width($breakpoint) {
|
|
84
|
-
#{$property-value}: var(--spacing-#{$size}) !important;
|
|
37
|
+
@if meta.type-of($direction-value) == 'list' {
|
|
38
|
+
@each $d in $direction-value {
|
|
39
|
+
@include responsive-utility("#{$type}#{$direction-key}-#{$size}", (
|
|
40
|
+
#{$property-value}-#{$d}: var(--spacing-#{$size}) !important
|
|
41
|
+
));
|
|
85
42
|
}
|
|
43
|
+
} @else {
|
|
44
|
+
@include responsive-utility("#{$type}#{$direction-key}-#{$size}", (
|
|
45
|
+
#{$property-value}-#{$direction-value}: var(--spacing-#{$size}) !important
|
|
46
|
+
));
|
|
86
47
|
}
|
|
87
48
|
}
|
|
88
49
|
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
@use '../core/namespace' as *;
|
|
2
|
-
@use '../settings/breakpoints' as bp;
|
|
3
|
-
@use '../core/spacing' as sp;
|
|
4
|
-
@use "sass:map";
|
|
5
|
-
|
|
6
|
-
// === Containers ===
|
|
7
|
-
$container-paddings: (
|
|
8
|
-
sm: sm,
|
|
9
|
-
md: sm,
|
|
10
|
-
lg: md,
|
|
11
|
-
xl: md
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
// === Base container ===
|
|
15
|
-
// Ex: .av-container, .av-container-fluid
|
|
16
|
-
@include ns("container") {
|
|
17
|
-
max-width: 90rem;
|
|
18
|
-
margin-left: auto;
|
|
19
|
-
margin-right: auto;
|
|
20
|
-
padding-left: sp.get(sm);
|
|
21
|
-
padding-right: sp.get(sm);
|
|
22
|
-
|
|
23
|
-
&-fluid {
|
|
24
|
-
max-width: none;
|
|
25
|
-
padding-left: 0;
|
|
26
|
-
padding-right: 0;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// === Responsive containers ===
|
|
32
|
-
// Ex: .av-container--md / .av-container--lg
|
|
33
|
-
@each $bp-name, $bp-value in bp.$breakpoints {
|
|
34
|
-
@media (min-width: #{$bp-value}) {
|
|
35
|
-
@include ns("container--#{$bp-name}") {
|
|
36
|
-
width: 100%;
|
|
37
|
-
max-width: #{$bp-value};
|
|
38
|
-
margin-left: auto;
|
|
39
|
-
margin-right: auto;
|
|
40
|
-
padding-left: sp.get(map.get($container-paddings, $bp-name));
|
|
41
|
-
padding-right: sp.get(map.get($container-paddings, $bp-name));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// === Rows ===
|
|
47
|
-
$row-justifications: (
|
|
48
|
-
left: flex-start,
|
|
49
|
-
right: flex-end,
|
|
50
|
-
center: center,
|
|
51
|
-
between: space-between
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
$row-alignments: (
|
|
55
|
-
top: flex-start,
|
|
56
|
-
middle: center,
|
|
57
|
-
bottom: flex-end
|
|
58
|
-
);
|
|
59
|
-
|
|
60
|
-
// === Mixin row layout ===
|
|
61
|
-
@mixin row-layout {
|
|
62
|
-
display: flex;
|
|
63
|
-
flex-direction: row;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// === Base row ===
|
|
67
|
-
// Ex: .av-row / .av-row-wrap / .av-row-nowrap
|
|
68
|
-
@include ns("row") {
|
|
69
|
-
@include row-layout;
|
|
70
|
-
|
|
71
|
-
&-wrap {
|
|
72
|
-
flex-wrap: wrap;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&-nowrap {
|
|
76
|
-
flex-wrap: nowrap;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// === Responsive layout for rows ===
|
|
81
|
-
// Ex: .av-row--md
|
|
82
|
-
@each $bp-name, $bp-value in bp.$breakpoints {
|
|
83
|
-
@media (min-width: #{$bp-value}) {
|
|
84
|
-
@include ns("row--#{$bp-name}") {
|
|
85
|
-
@include row-layout;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// === Columns ===
|
|
91
|
-
$col-alignments: (
|
|
92
|
-
top: flex-start,
|
|
93
|
-
middle: center,
|
|
94
|
-
bottom: flex-end
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
// === Mixin column layout ===
|
|
98
|
-
@mixin col-layout {
|
|
99
|
-
display: flex;
|
|
100
|
-
flex-direction: column;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// === Base column ===
|
|
104
|
-
// Ex: .av-col
|
|
105
|
-
@include ns("col") {
|
|
106
|
-
@include col-layout;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// === Responsive layout for columns ===
|
|
110
|
-
// Ex: .av-col--md
|
|
111
|
-
@each $bp-name, $bp-value in bp.$breakpoints {
|
|
112
|
-
@media (min-width: #{$bp-value}) {
|
|
113
|
-
@include ns("col--#{$bp-name}") {
|
|
114
|
-
@include col-layout;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
@use './namespace' as *;
|
|
2
|
-
|
|
3
|
-
@include ns("sr-only") {
|
|
4
|
-
position: absolute !important;
|
|
5
|
-
width: 1px !important;
|
|
6
|
-
height: 1px !important;
|
|
7
|
-
padding: 0 !important;
|
|
8
|
-
margin: -1px !important;
|
|
9
|
-
overflow: hidden !important;
|
|
10
|
-
clip: rect(0, 0, 0, 0) !important;
|
|
11
|
-
white-space: nowrap !important;
|
|
12
|
-
border: 0 !important;
|
|
13
|
-
display: block !important;
|
|
14
|
-
}
|