@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,148 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
@use "lite-helpers";
|
|
4
|
+
|
|
5
|
+
// Carrega módulos do Sass
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:string";
|
|
8
|
+
|
|
9
|
+
// Configurações do módulo
|
|
10
|
+
$namespacing: "spacing";
|
|
11
|
+
$module-map: map.get(utils.$tokens, utils.$prefix, $namespacing);
|
|
12
|
+
$scope: #{utils.$prefix}-#{$namespacing};
|
|
13
|
+
|
|
14
|
+
@mixin spacing($property, $breakpoint, $negative, $directions) {
|
|
15
|
+
$scale: "layout";
|
|
16
|
+
|
|
17
|
+
@each $dir in $directions {
|
|
18
|
+
// Define o sufixo para a propriedade e classe (ex: "-top", "-inline" ou "")
|
|
19
|
+
$suffix: "";
|
|
20
|
+
|
|
21
|
+
@if $dir != "" {
|
|
22
|
+
$suffix: "-#{$dir}";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// 1. Loop para os tokens numéricos da escala
|
|
26
|
+
@each $spacing in map.keys(map.get($module-map, $scale)) {
|
|
27
|
+
$token-name: $spacing;
|
|
28
|
+
|
|
29
|
+
// Cria o nome da classe e o estilo correspondente
|
|
30
|
+
$class-name: "#{$property}#{$suffix}-#{$token-name}";
|
|
31
|
+
|
|
32
|
+
@if $negative {
|
|
33
|
+
$class-name: "#{$property}-negative#{$suffix}-#{$token-name}";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
37
|
+
#{$property}#{$suffix}: var(--#{$scope}-#{$scale}-#{$token-name});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 2. Valores especiais (apenas para a variação positiva)
|
|
42
|
+
@if not $negative {
|
|
43
|
+
// Valor Zero (0)
|
|
44
|
+
$class-zero: "#{$property}#{$suffix}-0";
|
|
45
|
+
.#{utils.class-with-breakpoint($class-zero, $breakpoint)} {
|
|
46
|
+
#{$property}#{$suffix}: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Valor Automático (auto) - Apenas para margin
|
|
50
|
+
@if $property == "margin" {
|
|
51
|
+
$class-auto: "#{$property}#{$suffix}-auto";
|
|
52
|
+
.#{utils.class-with-breakpoint($class-auto, $breakpoint)} {
|
|
53
|
+
#{$property}#{$suffix}: auto;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/// Cria espaçamentos por direção
|
|
61
|
+
/// @param {String} $property - Propriedade CSS (margin ou padding)
|
|
62
|
+
/// @param {String} $breakpoint - Nome do breakpoint (opcional)
|
|
63
|
+
/// @param {Boolean} $negative - Indica se o espaçamento deve ser negativo (opcional)
|
|
64
|
+
@mixin side-spacing($property, $breakpoint, $negative: false) {
|
|
65
|
+
@include spacing($property, $breakpoint, $negative, ("top", "right", "bottom", "left"));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// Cria espaçamentos
|
|
69
|
+
/// @param {String} $property - Propriedade CSS (margin ou padding)
|
|
70
|
+
/// @param {String} $breakpoint - Nome do breakpoint (opcional)
|
|
71
|
+
/// @param {Boolean} $negative - Indica se o espaçamento deve ser negativo (opcional)
|
|
72
|
+
@mixin all-spacing($property, $breakpoint, $negative: false) {
|
|
73
|
+
@include spacing($property, $breakpoint, $negative, (""));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/// Cria espaçamentos lógicos (horizontal e vertical)
|
|
77
|
+
/// @param {String} $property - Propriedade CSS (margin ou padding)
|
|
78
|
+
/// @param {String} $breakpoint - Nome do breakpoint (opcional)
|
|
79
|
+
/// @param {Boolean} $negative - Indica se o espaçamento deve ser negativo (opcional)
|
|
80
|
+
@mixin logical-spacing($property, $breakpoint, $negative: false) {
|
|
81
|
+
@include spacing($property, $breakpoint, $negative, ("inline", "block"));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// Cria espaçamentos com custom variable (sem sufixo de valor)
|
|
85
|
+
/// @param {String} $property - Propriedade CSS (margin ou padding)
|
|
86
|
+
/// @param {String} $breakpoint - Nome do breakpoint (opcional)
|
|
87
|
+
/// @param {String} $variable - Nome da custom variable (ex: "grid-gutter", "container-padding")
|
|
88
|
+
/// @param {List} $directions - Lista de direções (opcional)
|
|
89
|
+
@mixin variable-spacing($property, $breakpoint, $variable, $directions: ("top", "right", "bottom", "left")) {
|
|
90
|
+
@each $dir in $directions {
|
|
91
|
+
$suffix: "";
|
|
92
|
+
|
|
93
|
+
@if $dir != "" {
|
|
94
|
+
$suffix: "-#{$dir}";
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
$class-name: "#{$property}#{$suffix}";
|
|
98
|
+
|
|
99
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
100
|
+
#{$property}#{$suffix}: var(--#{$variable});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/// Cria espaçamentos com custom variable para todas as direções
|
|
106
|
+
/// @param {String} $property - Propriedade CSS (margin ou padding)
|
|
107
|
+
/// @param {String} $breakpoint - Nome do breakpoint (opcional)
|
|
108
|
+
/// @param {String} $variable - Nome da custom variable
|
|
109
|
+
@mixin all-variable-spacing($property, $breakpoint, $variable) {
|
|
110
|
+
@include variable-spacing($property, $breakpoint, $variable, (""));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/// Cria espaçamentos com custom variable lógicos (inline e block)
|
|
114
|
+
/// @param {String} $property - Propriedade CSS (margin ou padding)
|
|
115
|
+
/// @param {String} $breakpoint - Nome do breakpoint (opcional)
|
|
116
|
+
/// @param {String} $variable - Nome da custom variable
|
|
117
|
+
@mixin logical-variable-spacing($property, $breakpoint, $variable) {
|
|
118
|
+
@include variable-spacing($property, $breakpoint, $variable, ("inline", "block"));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/// Gera todas as classes de espaçamento
|
|
122
|
+
/// @param {String} $breakpoint - Nome do breakpoint (opcional)
|
|
123
|
+
@mixin make-spacing($breakpoint: null) {
|
|
124
|
+
// Verifica se deve incluir as classes para todas as direções ou apenas as nomeadas
|
|
125
|
+
@if lite-helpers.should-include-all-directions("spacing") {
|
|
126
|
+
@include all-spacing("margin", $breakpoint);
|
|
127
|
+
@include all-spacing("padding", $breakpoint);
|
|
128
|
+
@include logical-spacing("margin", $breakpoint);
|
|
129
|
+
@include logical-spacing("padding", $breakpoint);
|
|
130
|
+
@include all-variable-spacing("margin", $breakpoint, "grid-gutter");
|
|
131
|
+
@include all-variable-spacing("padding", $breakpoint, "grid-gutter");
|
|
132
|
+
@include logical-variable-spacing("margin", $breakpoint, "grid-gutter");
|
|
133
|
+
@include logical-variable-spacing("padding", $breakpoint, "grid-gutter");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Inclui as classes para cada direção
|
|
137
|
+
@include side-spacing("margin", $breakpoint);
|
|
138
|
+
@include side-spacing("padding", $breakpoint);
|
|
139
|
+
@include variable-spacing("margin", $breakpoint, "grid-gutter");
|
|
140
|
+
@include variable-spacing("padding", $breakpoint, "grid-gutter");
|
|
141
|
+
|
|
142
|
+
// Verifica se deve incluir as classes para espaçamentos negativos
|
|
143
|
+
@if lite-helpers.should-include-negative("spacing") {
|
|
144
|
+
@include all-spacing("margin", $breakpoint, $negative: true);
|
|
145
|
+
@include side-spacing("margin", $breakpoint, $negative: true);
|
|
146
|
+
@include logical-spacing("margin", $breakpoint, $negative: true);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
@use "lite-helpers";
|
|
4
|
+
|
|
5
|
+
// Carrega módulos do Sass
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
|
|
8
|
+
// Configurações do módulo
|
|
9
|
+
$namespacing: "surface";
|
|
10
|
+
$module-map: map.get(utils.$tokens, utils.$prefix, $namespacing);
|
|
11
|
+
$scope: #{utils.$prefix}-#{$namespacing};
|
|
12
|
+
|
|
13
|
+
/// Cria posições
|
|
14
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
15
|
+
@mixin position($breakpoint: null) {
|
|
16
|
+
@each $position in "absolute", "fixed", "relative", "static", "sticky" {
|
|
17
|
+
// Ex: "position-absolute"
|
|
18
|
+
$class-name: "position-#{$position}";
|
|
19
|
+
|
|
20
|
+
// Adiciona breakpoint caso seja passado
|
|
21
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
22
|
+
position: #{$position};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// Cria overflows
|
|
28
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
29
|
+
@mixin overflow($breakpoint: null) {
|
|
30
|
+
@each $overflow in "auto", "hidden", "visible" {
|
|
31
|
+
// Ex: "overflow-auto"
|
|
32
|
+
$class-name: "overflow-#{$overflow}";
|
|
33
|
+
|
|
34
|
+
// Adiciona breakpoint caso seja passado
|
|
35
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
36
|
+
overflow: #{$overflow};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/// Cria espessura de borda
|
|
42
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
43
|
+
@mixin border-width($breakpoint: null) {
|
|
44
|
+
$property: "borderWidth";
|
|
45
|
+
|
|
46
|
+
@each $style in "solid", "dashed", "dotted" {
|
|
47
|
+
.#{utils.class-with-breakpoint("border-#{$style}", $breakpoint)} {
|
|
48
|
+
border-color: var(--br-color-border-primary);
|
|
49
|
+
border-style: #{$style};
|
|
50
|
+
border-width: var(--br-surface-border-width-sm);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@each $width in map.keys(map.get($module-map, $property)) {
|
|
55
|
+
// Converte termos de PascalCase para kebab-case
|
|
56
|
+
$property: utils.pascal-to-kebab($property);
|
|
57
|
+
|
|
58
|
+
// Ex: "border-width-md"
|
|
59
|
+
$class-name: "#{$property}-#{$width}";
|
|
60
|
+
|
|
61
|
+
// Adiciona breakpoint caso seja passado
|
|
62
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
63
|
+
border-width: var(--#{$scope}-#{$property}-#{$width});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// Cria arredondamento
|
|
69
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
70
|
+
@mixin rounded($breakpoint: null) {
|
|
71
|
+
$property: "rounder";
|
|
72
|
+
|
|
73
|
+
@each $radius in map.keys(map.get($module-map, $property)) {
|
|
74
|
+
// Ex: "rounded-md"
|
|
75
|
+
$class-name: "rounded-#{$radius}";
|
|
76
|
+
|
|
77
|
+
// Adiciona breakpoint caso seja passado
|
|
78
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
79
|
+
border-radius: var(--#{$scope}-#{$property}-#{$radius});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// Cria opacidade
|
|
85
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
86
|
+
@mixin opacity($breakpoint: null) {
|
|
87
|
+
$property: "opacity";
|
|
88
|
+
|
|
89
|
+
@each $opacity in map.keys(map.get($module-map, $property)) {
|
|
90
|
+
// Ex: "opacity-50"
|
|
91
|
+
$class-name: "opacity-#{$opacity}";
|
|
92
|
+
|
|
93
|
+
// Adiciona breakpoint caso seja passado
|
|
94
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
95
|
+
opacity: var(--#{$scope}-#{$property}-#{$opacity});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/// Cria displays
|
|
101
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
102
|
+
@mixin display($breakpoint: null) {
|
|
103
|
+
@each $display in "block", "flex", "inline", "inline-block", "inline-flex", "grid", "none" {
|
|
104
|
+
// Ex: "display-block"
|
|
105
|
+
$class-name: "display-#{$display}";
|
|
106
|
+
|
|
107
|
+
// Adiciona breakpoint caso seja passado
|
|
108
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
109
|
+
display: #{$display};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/// Gera classes de superfície
|
|
115
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
116
|
+
@mixin make-surface($breakpoint: null) {
|
|
117
|
+
@include border-width($breakpoint);
|
|
118
|
+
@include rounded($breakpoint);
|
|
119
|
+
@include display($breakpoint);
|
|
120
|
+
|
|
121
|
+
// Verifica se deve incluir as classes para opacidade
|
|
122
|
+
@if lite-helpers.should-include-opacity("surface") {
|
|
123
|
+
@include opacity($breakpoint);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Verifica se deve incluir as classes para posição
|
|
127
|
+
@if lite-helpers.should-include-position("surface") {
|
|
128
|
+
@include position($breakpoint);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Verifica se deve incluir as classes para overflow
|
|
132
|
+
@if lite-helpers.should-include-overflow("surface") {
|
|
133
|
+
@include overflow($breakpoint);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../core/utils";
|
|
3
|
+
@use "lite-helpers";
|
|
4
|
+
|
|
5
|
+
// Carrega módulos do Sass
|
|
6
|
+
@use "sass:map";
|
|
7
|
+
@use "sass:meta";
|
|
8
|
+
@use "sass:string";
|
|
9
|
+
|
|
10
|
+
// Configurações do módulo
|
|
11
|
+
$namespacing: "typography";
|
|
12
|
+
$module-map: map.get(utils.$tokens, utils.$prefix, $namespacing);
|
|
13
|
+
$scope: #{utils.$prefix}-#{$namespacing};
|
|
14
|
+
|
|
15
|
+
/// Cria text-align
|
|
16
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
17
|
+
@mixin text-align($breakpoint: null) {
|
|
18
|
+
$alignments: "left", "center", "right", "justify";
|
|
19
|
+
|
|
20
|
+
@each $alignment in $alignments {
|
|
21
|
+
.#{utils.class-with-breakpoint("text-#{$alignment}", $breakpoint)} {
|
|
22
|
+
text-align: #{$alignment};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// Cria text-transform
|
|
28
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
29
|
+
@mixin text-transform($breakpoint: null) {
|
|
30
|
+
$transformations: "uppercase", "lowercase", "capitalize";
|
|
31
|
+
|
|
32
|
+
@each $transformation in $transformations {
|
|
33
|
+
.#{utils.class-with-breakpoint("text-#{$transformation}", $breakpoint)} {
|
|
34
|
+
text-transform: #{$transformation};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// Cria text-wrap
|
|
40
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
41
|
+
@mixin text-wrap($breakpoint: null) {
|
|
42
|
+
$wraps: "wrap", "nowrap";
|
|
43
|
+
|
|
44
|
+
@each $wrap in $wraps {
|
|
45
|
+
.#{utils.class-with-breakpoint("text-#{$wrap}", $breakpoint)} {
|
|
46
|
+
white-space: #{$wrap};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Truncar o texto
|
|
51
|
+
.#{utils.class-with-breakpoint("text-truncate", $breakpoint)} {
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
text-overflow: ellipsis;
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Forçar quebra de linha
|
|
58
|
+
.#{utils.class-with-breakpoint("text-break", $breakpoint)} {
|
|
59
|
+
overflow-wrap: break-word;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/// Cria font-weight
|
|
64
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
65
|
+
@mixin font-weight($breakpoint: null) {
|
|
66
|
+
$property: "fontWeight";
|
|
67
|
+
|
|
68
|
+
@each $font-weight in map.keys(map.get($module-map, $property)) {
|
|
69
|
+
// Converte termos de PascalCase para kebab-case
|
|
70
|
+
$property: utils.pascal-to-kebab($property);
|
|
71
|
+
$font-weight: utils.pascal-to-kebab($font-weight);
|
|
72
|
+
|
|
73
|
+
// Ex: "font-weight-semi-bold"
|
|
74
|
+
$class-name: "font-weight-#{$font-weight}";
|
|
75
|
+
|
|
76
|
+
// Adiciona breakpoint caso seja passado
|
|
77
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
78
|
+
font-weight: var(--#{$scope}-#{$property}-#{$font-weight});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/// Cria font-size
|
|
84
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
85
|
+
@mixin font-size($breakpoint: null) {
|
|
86
|
+
$property: "fontSize";
|
|
87
|
+
|
|
88
|
+
// Converte "fontSize" para "font-size"
|
|
89
|
+
$property-kebab: utils.pascal-to-kebab($property);
|
|
90
|
+
|
|
91
|
+
@each $size in map.keys(map.get($module-map, $property)) {
|
|
92
|
+
// Mapas "up" e "down"
|
|
93
|
+
@if $size == "up" or $size == "down" {
|
|
94
|
+
@each $variation in map.keys(map.get($module-map, $property, $size)) {
|
|
95
|
+
$class-name: "font-size-#{$size}-#{$variation}";
|
|
96
|
+
|
|
97
|
+
// Adiciona breakpoint caso seja passado
|
|
98
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
99
|
+
font-size: var(--#{$scope}-#{$property-kebab}-#{$size}-#{$variation});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Valor "default"
|
|
105
|
+
@else if $size == "default" {
|
|
106
|
+
// Ex: "font-size-default"
|
|
107
|
+
$class-name: "font-size-#{$size}";
|
|
108
|
+
|
|
109
|
+
// Adiciona breakpoint caso seja passado
|
|
110
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
111
|
+
font-size: var(--#{$scope}-#{$property-kebab}-#{$size});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// Cria line-height
|
|
118
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
119
|
+
@mixin line-height($breakpoint: null) {
|
|
120
|
+
$property: "lineHeight";
|
|
121
|
+
|
|
122
|
+
@each $line-height in map.keys(map.get($module-map, $property)) {
|
|
123
|
+
// Converte termos de PascalCase para kebab-case
|
|
124
|
+
$property: utils.pascal-to-kebab($property);
|
|
125
|
+
$line-height: utils.pascal-to-kebab($line-height);
|
|
126
|
+
|
|
127
|
+
// Ex: "line-height-md"
|
|
128
|
+
$class-name: "line-height-#{$line-height}";
|
|
129
|
+
|
|
130
|
+
// Adiciona breakpoint caso seja passado
|
|
131
|
+
.#{utils.class-with-breakpoint($class-name, $breakpoint)} {
|
|
132
|
+
line-height: var(--#{$scope}-#{$property}-#{$line-height});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/// Gera classes de tipografia
|
|
138
|
+
/// @param {String} $breakpoint [null] - Um breakpoint opcional
|
|
139
|
+
@mixin make-typography($breakpoint: null) {
|
|
140
|
+
@include font-size($breakpoint);
|
|
141
|
+
|
|
142
|
+
// Verifica se deve incluir apenas classes de tamanhos
|
|
143
|
+
@if lite-helpers.should-include-only-sizes("typography") {
|
|
144
|
+
@include font-weight($breakpoint);
|
|
145
|
+
@include line-height($breakpoint);
|
|
146
|
+
@include text-align($breakpoint);
|
|
147
|
+
@include text-transform($breakpoint);
|
|
148
|
+
@include text-wrap($breakpoint);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/// Gerador centralizado de classes utilitárias com decisão sobre quais módulos incluir.
|
|
2
|
+
/// Este arquivo centraliza toda a responsabilidade de decidir quais módulos devem ser incluídos
|
|
3
|
+
/// baseado na configuração lite, deixando cada módulo responsável apenas por gerar suas classes.
|
|
4
|
+
|
|
5
|
+
@use "lite-helpers";
|
|
6
|
+
@use "color";
|
|
7
|
+
@use "typography";
|
|
8
|
+
@use "spacing";
|
|
9
|
+
@use "surface";
|
|
10
|
+
@use "grid";
|
|
11
|
+
@use "elevation";
|
|
12
|
+
@use "motion";
|
|
13
|
+
@use "flexbox";
|
|
14
|
+
@use "responsive";
|
|
15
|
+
|
|
16
|
+
/// Inclui um módulo se estiver habilitado na configuração lite.
|
|
17
|
+
/// @param {String} $module - Nome do módulo.
|
|
18
|
+
@mixin generate-if-enabled($module) {
|
|
19
|
+
@if lite-helpers.should-include-module($module) {
|
|
20
|
+
@content;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/// Gera todas as classes utilitárias.
|
|
25
|
+
@mixin make-all-utilities {
|
|
26
|
+
@include generate-if-enabled("typography") {
|
|
27
|
+
@include typography.make-typography;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@include generate-if-enabled("spacing") {
|
|
31
|
+
@include spacing.make-spacing;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@include generate-if-enabled("surface") {
|
|
35
|
+
@include surface.make-surface;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@include generate-if-enabled("color") {
|
|
39
|
+
@include color.make-color;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include generate-if-enabled("grid") {
|
|
43
|
+
@include grid.make-grid;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@include generate-if-enabled("elevation") {
|
|
47
|
+
@include elevation.make-elevation;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@include generate-if-enabled("motion") {
|
|
51
|
+
@include motion.make-motion;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@include generate-if-enabled("flexbox") {
|
|
55
|
+
@include flexbox.make-flexbox;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@include generate-if-enabled("responsive") {
|
|
59
|
+
@include responsive.make-responsive;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../../core/utils";
|
|
3
|
+
@use "../elevation";
|
|
4
|
+
|
|
5
|
+
// Constrói os utilitários
|
|
6
|
+
@include elevation.make-elevation;
|
|
7
|
+
|
|
8
|
+
/// Utilitários com breakpoints
|
|
9
|
+
@each $breakpoint in utils.$breakpoint-keys {
|
|
10
|
+
@include utils.from-breakpoint($breakpoint) {
|
|
11
|
+
@include elevation.make-elevation($breakpoint);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../../core/utils";
|
|
3
|
+
@use "../flexbox";
|
|
4
|
+
|
|
5
|
+
// Constrói os utilitários
|
|
6
|
+
@include flexbox.make-flexbox;
|
|
7
|
+
|
|
8
|
+
/// Utilitários com breakpoints
|
|
9
|
+
@each $breakpoint in utils.$breakpoint-keys {
|
|
10
|
+
@include utils.from-breakpoint($breakpoint) {
|
|
11
|
+
@include flexbox.make-flexbox($breakpoint);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../../core/utils";
|
|
3
|
+
@use "../grid";
|
|
4
|
+
|
|
5
|
+
// Constrói os utilitários
|
|
6
|
+
@include grid.make-grid;
|
|
7
|
+
|
|
8
|
+
/// Utilitários com breakpoints
|
|
9
|
+
@each $breakpoint in utils.$breakpoint-keys {
|
|
10
|
+
@include utils.from-breakpoint($breakpoint) {
|
|
11
|
+
@include grid.make-columns($breakpoint);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../../core/utils";
|
|
3
|
+
@use "../spacing";
|
|
4
|
+
|
|
5
|
+
// Constrói os utilitários
|
|
6
|
+
@include spacing.make-spacing;
|
|
7
|
+
|
|
8
|
+
/// Utilitários com breakpoints
|
|
9
|
+
@each $breakpoint in utils.$breakpoint-keys {
|
|
10
|
+
@include utils.from-breakpoint($breakpoint) {
|
|
11
|
+
@include spacing.make-spacing($breakpoint);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../../core/utils";
|
|
3
|
+
@use "../surface";
|
|
4
|
+
|
|
5
|
+
// Constrói os utilitários
|
|
6
|
+
@include surface.make-surface;
|
|
7
|
+
|
|
8
|
+
/// Utilitários com breakpoints
|
|
9
|
+
@each $breakpoint in utils.$breakpoint-keys {
|
|
10
|
+
@include utils.from-breakpoint($breakpoint) {
|
|
11
|
+
@include surface.make-surface($breakpoint);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Carrega os módulos do projeto
|
|
2
|
+
@use "../../core/utils";
|
|
3
|
+
@use "../typography";
|
|
4
|
+
|
|
5
|
+
// Constrói os utilitários
|
|
6
|
+
@include typography.make-typography;
|
|
7
|
+
|
|
8
|
+
/// Utilitários com breakpoints
|
|
9
|
+
@each $breakpoint in utils.$breakpoint-keys {
|
|
10
|
+
@include utils.from-breakpoint($breakpoint) {
|
|
11
|
+
@include typography.make-typography($breakpoint);
|
|
12
|
+
}
|
|
13
|
+
}
|