@govbr-ds/design 4.0.0-next.31
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 +21 -0
- package/README.md +73 -0
- package/dist/govbr-ds.css +1588 -0
- package/dist/govbr-ds.min.css +1 -0
- package/dist/govbr-utilities-lite.css +2811 -0
- package/dist/govbr-utilities-lite.min.css +1 -0
- package/dist/govbr-utilities.css +12667 -0
- package/dist/govbr-utilities.min.css +1 -0
- package/dist/modules/color.css +5674 -0
- package/dist/modules/elevation.css +113 -0
- package/dist/modules/flexbox.css +696 -0
- package/dist/modules/grid.css +518 -0
- package/dist/modules/motion.css +95 -0
- package/dist/modules/spacing.css +3928 -0
- package/dist/modules/surface.css +646 -0
- package/dist/modules/typography.css +706 -0
- package/package.json +65 -0
- package/src/core/_contrast.scss +2 -0
- package/src/core/_foundation.scss +227 -0
- package/src/core/_responsive.scss +9 -0
- package/src/core/_states.scss +121 -0
- package/src/core/_theme.scss +7 -0
- package/src/core/_tokens.scss +2 -0
- package/src/core/_utils.scss +116 -0
- package/src/core/govbr-ds.scss +9 -0
- package/src/utilities/_color.scss +139 -0
- package/src/utilities/_elevation.scss +47 -0
- package/src/utilities/_flexbox.scss +147 -0
- package/src/utilities/_grid.scss +137 -0
- package/src/utilities/_lite-config.scss +41 -0
- package/src/utilities/_lite-helpers.scss +137 -0
- package/src/utilities/_motion.scss +50 -0
- package/src/utilities/_responsive.scss +49 -0
- package/src/utilities/_spacing.scss +148 -0
- package/src/utilities/_surface.scss +135 -0
- package/src/utilities/_typography.scss +150 -0
- package/src/utilities/_utilities-generator.scss +61 -0
- package/src/utilities/govbr-utilities-lite.scss +4 -0
- package/src/utilities/govbr-utilities.scss +8 -0
- package/src/utilities/modules/color.scss +5 -0
- package/src/utilities/modules/elevation.scss +13 -0
- package/src/utilities/modules/flexbox.scss +13 -0
- package/src/utilities/modules/grid.scss +13 -0
- package/src/utilities/modules/motion.scss +5 -0
- package/src/utilities/modules/spacing.scss +13 -0
- package/src/utilities/modules/surface.scss +13 -0
- package/src/utilities/modules/typography.scss +13 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
|
|
4
|
+
// Carrega módulos do Sass
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
@use "sass:list";
|
|
7
|
+
@use "sass:string";
|
|
8
|
+
|
|
9
|
+
// Configurações do módulo
|
|
10
|
+
$namespacing: "elevation";
|
|
11
|
+
$module-map: map.get(utils.$tokens, utils.$prefix, $namespacing);
|
|
12
|
+
$scope: #{utils.$prefix}-#{$namespacing};
|
|
13
|
+
|
|
14
|
+
/// Cria sombras de elevação
|
|
15
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
16
|
+
@mixin shadow($breakpoint: null) {
|
|
17
|
+
$property: "shadowStyle";
|
|
18
|
+
|
|
19
|
+
// Retorna os níveis de sombra (ex: "level0", "level1", etc)
|
|
20
|
+
$map-elevations: map.keys(map.get($module-map, $property));
|
|
21
|
+
|
|
22
|
+
@each $elevation in $map-elevations {
|
|
23
|
+
// Retorna o índice de $elevation para calcular o z-index
|
|
24
|
+
$z-index: (list.index($map-elevations, $elevation) - 1) * 1000;
|
|
25
|
+
|
|
26
|
+
// Converte "level1" para "1"
|
|
27
|
+
$level-abbr: string.slice($elevation, -1);
|
|
28
|
+
|
|
29
|
+
// Converte "shadowStyle" para "shadow-style"
|
|
30
|
+
$property: utils.pascal-to-kebab($property);
|
|
31
|
+
|
|
32
|
+
// Ex: "elevation-1"
|
|
33
|
+
$class-name: "elevation-#{$level-abbr}";
|
|
34
|
+
|
|
35
|
+
// Adiciona breakpoint caso seja passado
|
|
36
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
37
|
+
box-shadow: var(--#{$scope}-#{$property}-#{$elevation});
|
|
38
|
+
z-index: $z-index;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/// Gera classes de elevação
|
|
44
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
45
|
+
@mixin make-elevation($breakpoint: null) {
|
|
46
|
+
@include shadow($breakpoint);
|
|
47
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
@use "spacing";
|
|
4
|
+
|
|
5
|
+
// Carrega módulos do Sass
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
|
|
8
|
+
/// Cria estilos de flex-wrap com suporte opcional a breakpoints.
|
|
9
|
+
@mixin flexbox-wrap($breakpoint: null) {
|
|
10
|
+
$wraps: "nowrap", "wrap", "wrap-reverse";
|
|
11
|
+
|
|
12
|
+
@each $wrap in $wraps {
|
|
13
|
+
.#{utils.class-with-breakpoint("flex-#{$wrap}", $breakpoint)} {
|
|
14
|
+
flex-wrap: #{$wrap};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/// Cria estilos de flex-direction com suporte opcional a breakpoints.
|
|
20
|
+
@mixin flexbox-direction($breakpoint: null) {
|
|
21
|
+
$directions: "row", "row-reverse", "column", "column-reverse";
|
|
22
|
+
|
|
23
|
+
@each $direction in $directions {
|
|
24
|
+
.#{utils.class-with-breakpoint("flex-#{$direction}", $breakpoint)} {
|
|
25
|
+
flex-direction: #{$direction};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/// Cria estilos de justify-content com suporte opcional a breakpoints.
|
|
31
|
+
@mixin justify($breakpoint: null) {
|
|
32
|
+
$justify: (
|
|
33
|
+
"start": flex-start,
|
|
34
|
+
"end": flex-end,
|
|
35
|
+
"center": center,
|
|
36
|
+
"between": space-between,
|
|
37
|
+
"around": space-around,
|
|
38
|
+
"evenly": space-evenly,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
@each $key, $value in $justify {
|
|
42
|
+
.#{utils.class-with-breakpoint("justify-content-#{$key}", $breakpoint)} {
|
|
43
|
+
justify-content: #{$value};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/// Cria estilos de align-items com suporte opcional a breakpoints.
|
|
49
|
+
@mixin align-items($breakpoint: null) {
|
|
50
|
+
$align-items: (
|
|
51
|
+
"start": flex-start,
|
|
52
|
+
"end": flex-end,
|
|
53
|
+
"center": center,
|
|
54
|
+
"baseline": baseline,
|
|
55
|
+
"stretch": stretch,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
@each $key, $value in $align-items {
|
|
59
|
+
.#{utils.class-with-breakpoint("align-items-#{$key}", $breakpoint)} {
|
|
60
|
+
align-items: #{$value};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/// Cria estilos de align-self com suporte opcional a breakpoints.
|
|
66
|
+
@mixin align-self($breakpoint: null) {
|
|
67
|
+
$align-self: (
|
|
68
|
+
"start": flex-start,
|
|
69
|
+
"end": flex-end,
|
|
70
|
+
"center": center,
|
|
71
|
+
"baseline": baseline,
|
|
72
|
+
"stretch": stretch,
|
|
73
|
+
"auto": auto,
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
@each $key, $value in $align-self {
|
|
77
|
+
.#{utils.class-with-breakpoint("align-self-#{$key}", $breakpoint)} {
|
|
78
|
+
align-self: #{$value};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/// Cria estilos de grow, shrink, fill com suporte opcional a breakpoints.
|
|
84
|
+
@mixin flexbox-fill($breakpoint: null) {
|
|
85
|
+
// Grow
|
|
86
|
+
@each $key in 1, 0 {
|
|
87
|
+
// Cria os estilos
|
|
88
|
+
.#{utils.class-with-breakpoint("flex-grow-#{$key}", $breakpoint)} {
|
|
89
|
+
flex-grow: #{$key};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Shrink
|
|
94
|
+
@each $key in 1, 0 {
|
|
95
|
+
// Cria os estilos
|
|
96
|
+
.#{utils.class-with-breakpoint("flex-shrink-#{$key}", $breakpoint)} {
|
|
97
|
+
flex-shrink: #{$key};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.#{utils.class-with-breakpoint("flex-fill", $breakpoint)} {
|
|
102
|
+
flex: 1 1 0;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/// Cria estilos de ordenamento com suporte opcional a breakpoints.
|
|
107
|
+
@mixin order($breakpoint: null) {
|
|
108
|
+
$order: (
|
|
109
|
+
"start": -1,
|
|
110
|
+
"default": 0,
|
|
111
|
+
"end": 1,
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
@each $key, $value in $order {
|
|
115
|
+
.#{utils.class-with-breakpoint("order-#{$key}", $breakpoint)} {
|
|
116
|
+
order: #{$value};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/// Cria estilos de gap com suporte opcional a breakpoints.
|
|
122
|
+
@mixin gap($breakpoint: null) {
|
|
123
|
+
$gap: map.get(spacing.$module-map, "layout");
|
|
124
|
+
|
|
125
|
+
@each $gap-key, $gap-value in $gap {
|
|
126
|
+
.#{utils.class-with-breakpoint("gap-#{$gap-key}", $breakpoint)} {
|
|
127
|
+
gap: var(--#{spacing.$scope}-layout-#{$gap-key});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Valor Zero (0)
|
|
132
|
+
.#{utils.class-with-breakpoint("gap-0", $breakpoint)} {
|
|
133
|
+
gap: 0;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/// Gera todas as classes de flexbox com suporte opcional a breakpoints.
|
|
138
|
+
@mixin make-flexbox($breakpoint: null) {
|
|
139
|
+
@include flexbox-wrap($breakpoint);
|
|
140
|
+
@include flexbox-direction($breakpoint);
|
|
141
|
+
@include justify($breakpoint);
|
|
142
|
+
@include align-items($breakpoint);
|
|
143
|
+
@include align-self($breakpoint);
|
|
144
|
+
@include flexbox-fill($breakpoint);
|
|
145
|
+
@include order($breakpoint);
|
|
146
|
+
@include gap($breakpoint);
|
|
147
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
|
|
4
|
+
// Carrega módulos do Sass
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
|
|
7
|
+
// Configurações do módulo
|
|
8
|
+
$namespacing: "grid";
|
|
9
|
+
$module-map: map.get(utils.$tokens, utils.$prefix, $namespacing);
|
|
10
|
+
$scope: #{utils.$prefix}-#{$namespacing};
|
|
11
|
+
|
|
12
|
+
/// Gera as classes da grid
|
|
13
|
+
@mixin modern-grid {
|
|
14
|
+
// Configura as custom properties globais para a grid
|
|
15
|
+
:root {
|
|
16
|
+
--grid-breakpoint: var(--#{$scope}-breakpoint-small-default);
|
|
17
|
+
--grid-gutter: var(--#{$scope}-gutter-small-regular);
|
|
18
|
+
--grid-margin: var(--#{$scope}-margin-small-regular);
|
|
19
|
+
--grid-columns: #{map.get(utils.$breakpoints, "xs", "columns")};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Configuração padrão dos containers
|
|
23
|
+
.container-fixed,
|
|
24
|
+
.container-fluid {
|
|
25
|
+
width: 100%;
|
|
26
|
+
padding-left: var(--grid-margin);
|
|
27
|
+
padding-right: var(--grid-margin);
|
|
28
|
+
|
|
29
|
+
&.compact {
|
|
30
|
+
--grid-margin: var(--#{$scope}-margin-small-compact);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.spacious {
|
|
34
|
+
--grid-margin: var(--#{$scope}-margin-small-spacious);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Configura para usar container queries
|
|
39
|
+
.container-fixed,
|
|
40
|
+
.container-fluid,
|
|
41
|
+
.grid > * {
|
|
42
|
+
container-type: inline-size;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Configura a largura máxima do container fixo
|
|
46
|
+
.container-fixed {
|
|
47
|
+
max-width: calc(var(--grid-breakpoint) + (var(--grid-margin) * 2));
|
|
48
|
+
margin-left: auto;
|
|
49
|
+
margin-right: auto;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.grid {
|
|
53
|
+
display: grid;
|
|
54
|
+
grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
|
|
55
|
+
gap: var(--grid-gutter);
|
|
56
|
+
|
|
57
|
+
&.compact {
|
|
58
|
+
--grid-gutter: var(--#{$scope}-gutter-small-compact);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.spacious {
|
|
62
|
+
--grid-gutter: var(--#{$scope}-gutter-small-spacious);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Gera as colunas
|
|
67
|
+
@include make-columns;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// Gera as classes de colunas para breakpoints específicos
|
|
71
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
72
|
+
@mixin make-columns($breakpoint: null) {
|
|
73
|
+
// Retorna "small", "medium" ou "large" com base no breakpoint
|
|
74
|
+
$breakpoint-size: map.get(utils.$breakpoints, $breakpoint, "size");
|
|
75
|
+
|
|
76
|
+
// Nomes para custom properties
|
|
77
|
+
$breakpoint-var: #{$scope}-breakpoint-#{$breakpoint-size};
|
|
78
|
+
$gutter-var: #{$scope}-gutter-#{$breakpoint-size};
|
|
79
|
+
$margin-var: #{$scope}-margin-#{$breakpoint-size};
|
|
80
|
+
$columns: #{map.get(utils.$breakpoints, $breakpoint, "columns")};
|
|
81
|
+
$max-columns: 12;
|
|
82
|
+
|
|
83
|
+
@if $breakpoint {
|
|
84
|
+
// Define as custom properties para o breakpoint específico
|
|
85
|
+
:root {
|
|
86
|
+
--grid-breakpoint: var(--#{$breakpoint-var}-default);
|
|
87
|
+
--grid-gutter: var(--#{$gutter-var}-regular);
|
|
88
|
+
--grid-margin: var(--#{$margin-var}-regular);
|
|
89
|
+
--grid-columns: #{$columns};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Atualiza as custom properties para o breakpoint específico
|
|
93
|
+
.container-fixed,
|
|
94
|
+
.container-fluid {
|
|
95
|
+
&.compact {
|
|
96
|
+
--grid-margin: var(--#{$margin-var}-compact);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&.spacious {
|
|
100
|
+
--grid-margin: var(--#{$margin-var}-spacious);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Atualiza o número de colunas para o breakpoint específico
|
|
105
|
+
.grid {
|
|
106
|
+
&.compact {
|
|
107
|
+
--grid-gutter: var(--#{$gutter-var}-compact);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&.spacious {
|
|
111
|
+
--grid-gutter: var(--#{$gutter-var}-spacious);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Cria as colunas
|
|
117
|
+
@for $i from 1 through $max-columns {
|
|
118
|
+
.#{utils.class-with-breakpoint("column-#{$i}", $breakpoint)} {
|
|
119
|
+
grid-column-end: span min(#{$i}, var(--grid-columns));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Cria os offsets
|
|
124
|
+
@for $i from 1 through ($max-columns - 1) {
|
|
125
|
+
.#{utils.class-with-breakpoint("column-offset-#{$i}", $breakpoint)} {
|
|
126
|
+
// Define cirurgicamente a linha vertical inicial da coluna
|
|
127
|
+
grid-column-start: #{$i + 1};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
.#{utils.class-with-breakpoint("column-offset-0", $breakpoint)} {
|
|
131
|
+
grid-column-start: auto;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@mixin make-grid {
|
|
136
|
+
@include modern-grid;
|
|
137
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// Flag para indicar se a build deve usar a configuração lite
|
|
2
|
+
$lite: false !default;
|
|
3
|
+
|
|
4
|
+
/// Configuração centralizada para a versão lite dos utilitários
|
|
5
|
+
/// Define quais módulos e recursos devem ser incluídos na versão lite
|
|
6
|
+
$lite-modules: (
|
|
7
|
+
"color": (
|
|
8
|
+
"enabled": true,
|
|
9
|
+
"include-all-colors": false,
|
|
10
|
+
),
|
|
11
|
+
"typography": (
|
|
12
|
+
"enabled": true,
|
|
13
|
+
"include-only-sizes": true,
|
|
14
|
+
),
|
|
15
|
+
"spacing": (
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"include-negative": false,
|
|
18
|
+
"include-all-directions": false,
|
|
19
|
+
),
|
|
20
|
+
"surface": (
|
|
21
|
+
"enabled": true,
|
|
22
|
+
"include-opacity": false,
|
|
23
|
+
"include-position": false,
|
|
24
|
+
"include-overflow": false,
|
|
25
|
+
),
|
|
26
|
+
"grid": (
|
|
27
|
+
"enabled": true,
|
|
28
|
+
),
|
|
29
|
+
"elevation": (
|
|
30
|
+
"enabled": false,
|
|
31
|
+
),
|
|
32
|
+
"motion": (
|
|
33
|
+
"enabled": false,
|
|
34
|
+
),
|
|
35
|
+
"flexbox": (
|
|
36
|
+
"enabled": false,
|
|
37
|
+
),
|
|
38
|
+
"responsive": (
|
|
39
|
+
"enabled": true,
|
|
40
|
+
),
|
|
41
|
+
) !default;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "lite-config";
|
|
3
|
+
|
|
4
|
+
// Carrega módulos do Sass
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
|
|
7
|
+
/// Informa se a build atual está no modo lite.
|
|
8
|
+
/// @return {Boolean}
|
|
9
|
+
@function is-lite-version() {
|
|
10
|
+
@return lite-config.$lite;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/// Retorna o mapa de configuração de um módulo na versão lite.
|
|
14
|
+
/// @param {String} $module - Nome do módulo.
|
|
15
|
+
/// @return {Map|null}
|
|
16
|
+
@function get-module-config($module) {
|
|
17
|
+
@return map.get(lite-config.$lite-modules, $module);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/// Retorna uma configuração específica de um módulo.
|
|
21
|
+
/// @param {String} $module - Nome do módulo.
|
|
22
|
+
/// @param {String} $setting - Nome da configuração.
|
|
23
|
+
/// @param {*} $default [null] - Valor padrão quando não houver configuração.
|
|
24
|
+
/// @return {*}
|
|
25
|
+
@function get-module-setting($module, $setting, $default: null) {
|
|
26
|
+
@if not is-lite-version() {
|
|
27
|
+
@return $default;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
$module-config: get-module-config($module);
|
|
31
|
+
|
|
32
|
+
@if not $module-config or not map.has-key($module-config, $setting) {
|
|
33
|
+
@return $default;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@return map.get($module-config, $setting);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// Define se um módulo deve ser incluído na build.
|
|
40
|
+
/// @param {String} $module - Nome do módulo.
|
|
41
|
+
/// @return {Boolean}
|
|
42
|
+
@function should-include-module($module) {
|
|
43
|
+
@if not is-lite-version() {
|
|
44
|
+
@return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@return get-module-setting($module, "enabled", false);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/// Filtra um mapa de valores de acordo com a configuração lite do módulo.
|
|
51
|
+
/// @param {String} $module - Nome do módulo.
|
|
52
|
+
/// @param {Map} $values - Mapa de valores a filtrar.
|
|
53
|
+
/// @return {Map}
|
|
54
|
+
@function filter-values-by-module($module, $values) {
|
|
55
|
+
@if not is-lite-version() or should-include-module($module) {
|
|
56
|
+
@return $values;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@return ();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// Define se o módulo deve gerar apenas classes para tamanhos.
|
|
63
|
+
/// @param {String} $module - Nome do módulo.
|
|
64
|
+
/// @return {Boolean}
|
|
65
|
+
@function should-include-only-sizes($module) {
|
|
66
|
+
@if not is-lite-version() {
|
|
67
|
+
@return true;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@return not get-module-setting($module, "include-only-sizes", true);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/// Define se deve gerar utilitários negativos para o módulo.
|
|
74
|
+
/// @param {String} $module - Nome do módulo.
|
|
75
|
+
/// @return {Boolean}
|
|
76
|
+
@function should-include-negative($module) {
|
|
77
|
+
@if not is-lite-version() {
|
|
78
|
+
@return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@return get-module-setting($module, "include-negative", true);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// Define se deve gerar utilitários de opacidade para o módulo.
|
|
85
|
+
/// @param {String} $module - Nome do módulo.
|
|
86
|
+
/// @return {Boolean}
|
|
87
|
+
@function should-include-opacity($module) {
|
|
88
|
+
@if not is-lite-version() {
|
|
89
|
+
@return true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@return get-module-setting($module, "include-opacity", true);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/// Define se deve gerar utilitários de posição para o módulo.
|
|
96
|
+
/// @param {String} $module - Nome do módulo.
|
|
97
|
+
/// @return {Boolean}
|
|
98
|
+
@function should-include-position($module) {
|
|
99
|
+
@if not is-lite-version() {
|
|
100
|
+
@return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@return get-module-setting($module, "include-position", true);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/// Define se deve gerar utilitários de overflow para o módulo.
|
|
107
|
+
/// @param {String} $module - Nome do módulo.
|
|
108
|
+
/// @return {Boolean}
|
|
109
|
+
@function should-include-overflow($module) {
|
|
110
|
+
@if not is-lite-version() {
|
|
111
|
+
@return true;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@return get-module-setting($module, "include-overflow", true);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// Define se o módulo deve gerar apenas classes por direção nomeada.
|
|
118
|
+
/// @param {String} $module - Nome do módulo.
|
|
119
|
+
/// @return {Boolean}
|
|
120
|
+
@function should-include-all-directions($module) {
|
|
121
|
+
@if not is-lite-version() {
|
|
122
|
+
@return true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@return get-module-setting($module, "include-all-directions", true);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/// Define se o módulo color deve gerar classes para todas as cores.
|
|
129
|
+
/// @param {String} $module - Nome do módulo.
|
|
130
|
+
/// @return {Boolean}
|
|
131
|
+
@function should-include-all-colors($module) {
|
|
132
|
+
@if not is-lite-version() {
|
|
133
|
+
@return true;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@return get-module-setting($module, "include-all-colors", true);
|
|
137
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
|
|
4
|
+
// Carrega módulos do Sass
|
|
5
|
+
@use "sass:map";
|
|
6
|
+
|
|
7
|
+
// Configurações do módulo
|
|
8
|
+
$namespacing: "motion";
|
|
9
|
+
$module-map: map.get(utils.$tokens, utils.$prefix, $namespacing);
|
|
10
|
+
$scope: #{utils.$prefix}-#{$namespacing};
|
|
11
|
+
|
|
12
|
+
/// Gera classes utilitárias para atenuações.
|
|
13
|
+
@mixin make-easings {
|
|
14
|
+
$property: "easing";
|
|
15
|
+
|
|
16
|
+
@each $easing in map.keys(map.get($module-map, $property)) {
|
|
17
|
+
// Converte termos de PascalCase para kebab-case
|
|
18
|
+
$easing: utils.pascal-to-kebab($easing);
|
|
19
|
+
|
|
20
|
+
.#{$property}-#{$easing} {
|
|
21
|
+
animation-timing-function: var(--#{$scope}-#{$property}-#{$easing});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@mixin make-durations {
|
|
27
|
+
$property: "duration";
|
|
28
|
+
|
|
29
|
+
@each $duration in map.keys(map.get($module-map, $property)) {
|
|
30
|
+
@if $duration == "none" {
|
|
31
|
+
.#{$property}-#{$duration} {
|
|
32
|
+
animation-duration: var(--#{$scope}-#{$property}-#{$duration});
|
|
33
|
+
}
|
|
34
|
+
} @else {
|
|
35
|
+
@each $speed in map.keys(map.get($module-map, $property, $duration)) {
|
|
36
|
+
// Converte termos de PascalCase para kebab-case
|
|
37
|
+
$duration: utils.pascal-to-kebab($duration);
|
|
38
|
+
|
|
39
|
+
.#{$property}-#{$duration}-#{$speed} {
|
|
40
|
+
animation-duration: var(--#{$scope}-#{$property}-#{$duration}-#{$speed});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@mixin make-motion {
|
|
48
|
+
@include make-easings;
|
|
49
|
+
@include make-durations;
|
|
50
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
@use "lite-helpers";
|
|
4
|
+
@use "typography";
|
|
5
|
+
@use "spacing";
|
|
6
|
+
@use "surface";
|
|
7
|
+
@use "grid";
|
|
8
|
+
@use "elevation";
|
|
9
|
+
@use "flexbox";
|
|
10
|
+
|
|
11
|
+
// Carrega módulos do Sass
|
|
12
|
+
@use "sass:map";
|
|
13
|
+
|
|
14
|
+
/// Aplica os estilos com breakpoints
|
|
15
|
+
@mixin make-responsive {
|
|
16
|
+
@each $breakpoint in utils.$breakpoint-keys {
|
|
17
|
+
@include utils.from-breakpoint($breakpoint) {
|
|
18
|
+
// Tipografia
|
|
19
|
+
@if lite-helpers.should-include-module("typography") {
|
|
20
|
+
@include typography.make-typography($breakpoint);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Espaçamento
|
|
24
|
+
@if lite-helpers.should-include-module("spacing") {
|
|
25
|
+
@include spacing.make-spacing($breakpoint);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Superfície
|
|
29
|
+
@if lite-helpers.should-include-module("surface") {
|
|
30
|
+
@include surface.make-surface($breakpoint);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Grid
|
|
34
|
+
@if lite-helpers.should-include-module("grid") {
|
|
35
|
+
@include grid.make-columns($breakpoint);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Elevação
|
|
39
|
+
@if lite-helpers.should-include-module("elevation") {
|
|
40
|
+
@include elevation.make-elevation($breakpoint);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Flexbox
|
|
44
|
+
@if lite-helpers.should-include-module("flexbox") {
|
|
45
|
+
@include flexbox.make-flexbox($breakpoint);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|