@govbr-ds/design 4.0.0-next.33 → 4.0.0-next.34
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 +8 -22
- package/dist/govbr-ds.css +102 -33
- package/dist/govbr-ds.min.css +1 -1
- package/docs/guia-de-uso.md +87 -0
- package/docs/guia-utilitarios.md +89 -0
- package/docs/modulo-cor.md +105 -0
- package/docs/modulo-elevacao.md +32 -0
- package/docs/modulo-espacamento.md +65 -0
- package/docs/modulo-flexbox.md +129 -0
- package/docs/modulo-grid.md +460 -0
- package/docs/modulo-movimento.md +49 -0
- package/docs/modulo-superficie.md +135 -0
- package/docs/modulo-tipografia.md +141 -0
- package/package.json +4 -3
- package/src/core/_states.scss +87 -9
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Módulo Tipografia
|
|
2
|
+
|
|
3
|
+
Os utilitários de tipografia permitem ajustar peso, tamanho, entrelinha, alinhamento e transformação de texto.
|
|
4
|
+
|
|
5
|
+
Existem também as classes de estilos tipográficos use-as quando não é possível usar a tag HTML correspondente.
|
|
6
|
+
|
|
7
|
+
## Estilos semânticos
|
|
8
|
+
|
|
9
|
+
### Títulos
|
|
10
|
+
|
|
11
|
+
- `h1`: Aplica estilo *Heading 1*;
|
|
12
|
+
- `h2`: Aplica estilo *Heading 2*;
|
|
13
|
+
- `h3`: Aplica estilo *Heading 3*;
|
|
14
|
+
- `h4`: Aplica estilo *Heading 4*;
|
|
15
|
+
- `h5`: Aplica estilo *Heading 5*;
|
|
16
|
+
- `h6`: Aplica estilo *Heading 6*.
|
|
17
|
+
|
|
18
|
+
> 📌 **Não esqueça**:
|
|
19
|
+
>
|
|
20
|
+
> - Priorize a semântica correta dos títulos para depois modificar o estilo com utilitário.
|
|
21
|
+
|
|
22
|
+
### Família de fonte
|
|
23
|
+
|
|
24
|
+
- `sans`: Aplica a família de fonte sem serifa;
|
|
25
|
+
- `mono`: Aplica a família de fonte monoespaçada;
|
|
26
|
+
- `serif`: Aplica a família de fonte com serifa.
|
|
27
|
+
|
|
28
|
+
### Outros
|
|
29
|
+
|
|
30
|
+
- `label`: Aplica o estilo de *label*;
|
|
31
|
+
- `legend`: Aplica o estilo de *legend*;
|
|
32
|
+
- `code`: Aplica o estilo de código.
|
|
33
|
+
|
|
34
|
+
### Exemplo
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<!-- Usar quando não é possível usar a tag <h2> -->
|
|
38
|
+
<div class="h2">Título da seção</div>
|
|
39
|
+
|
|
40
|
+
<!-- Aplicar família monoespaçada a um trecho de texto -->
|
|
41
|
+
<span class="mono">const x = 1;</span>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Peso da fonte
|
|
45
|
+
|
|
46
|
+
Define a espessura da fonte:
|
|
47
|
+
|
|
48
|
+
- `font-weight-thin`: peso 100;
|
|
49
|
+
- `font-weight-extra-light`: peso 200;
|
|
50
|
+
- `font-weight-light`: peso 300;
|
|
51
|
+
- `font-weight-regular`: peso 400;
|
|
52
|
+
- `font-weight-medium`: peso 500;
|
|
53
|
+
- `font-weight-semi-bold`: peso 600;
|
|
54
|
+
- `font-weight-bold`: peso 700;
|
|
55
|
+
- `font-weight-extra-bold`: peso 800;
|
|
56
|
+
- `font-weight-black`: peso 900.
|
|
57
|
+
|
|
58
|
+
> 👍 **Assim que se faz**:
|
|
59
|
+
>
|
|
60
|
+
> Modifique o comportamento por ***breakpoint***, exemplos: `.from-sm-font-weight-bold`, `.from-lg-font-weight-regular`.
|
|
61
|
+
|
|
62
|
+
## Tamanho da fonte
|
|
63
|
+
|
|
64
|
+
Define a escala tipográfica:
|
|
65
|
+
|
|
66
|
+
- `font-size-down-4`
|
|
67
|
+
- `font-size-down-3`
|
|
68
|
+
- `font-size-down-2`
|
|
69
|
+
- `font-size-down-1`
|
|
70
|
+
- `font-size-default`
|
|
71
|
+
- `font-size-up-1`
|
|
72
|
+
- `font-size-up-2`
|
|
73
|
+
- `font-size-up-3`
|
|
74
|
+
- `font-size-up-4`
|
|
75
|
+
- `font-size-up-5`
|
|
76
|
+
- `font-size-up-6`
|
|
77
|
+
- `font-size-up-7`
|
|
78
|
+
- `font-size-up-8`
|
|
79
|
+
|
|
80
|
+
> 👍 **Assim que se faz**:
|
|
81
|
+
>
|
|
82
|
+
> Modifique o comportamento por ***breakpoint***, exemplos: `.from-sm-font-size-down-01`, `.from-lg-font-size-up-02`, `.from-md-font-size-default`.
|
|
83
|
+
|
|
84
|
+
## Entrelinha (*line-height*)
|
|
85
|
+
|
|
86
|
+
- `line-height-xsm`
|
|
87
|
+
- `line-height-sm`
|
|
88
|
+
- `line-height-md`
|
|
89
|
+
- `line-height-lg`
|
|
90
|
+
- `line-height-xlg`
|
|
91
|
+
- `line-height-2xlg`
|
|
92
|
+
- `line-height-3xlg`
|
|
93
|
+
- `line-height-4xlg`
|
|
94
|
+
- `line-height-5xlg`
|
|
95
|
+
- `line-height-6xlg`
|
|
96
|
+
|
|
97
|
+
> 👍 **Assim que se faz**:
|
|
98
|
+
>
|
|
99
|
+
> Modifique o comportamento por ***breakpoint***, exemplos: `.from-sm-line-height-md`, `.from-lg-line-height-4xlg`.
|
|
100
|
+
|
|
101
|
+
## Alinhamento
|
|
102
|
+
|
|
103
|
+
Define o alinhamento do texto:
|
|
104
|
+
|
|
105
|
+
- `text-left`
|
|
106
|
+
- `text-right`
|
|
107
|
+
- `text-center`
|
|
108
|
+
- `text-justify`
|
|
109
|
+
|
|
110
|
+
> 👍 **Assim que se faz**:
|
|
111
|
+
>
|
|
112
|
+
> Modifique o comportamento por ***breakpoint***, exemplos: `.from-sm-text-left`, `.from-lg-text-center`.
|
|
113
|
+
|
|
114
|
+
## Transformações
|
|
115
|
+
|
|
116
|
+
Modifica a capitalização do texto:
|
|
117
|
+
|
|
118
|
+
- `text-lowercase`
|
|
119
|
+
- `text-uppercase`
|
|
120
|
+
- `text-capitalize`
|
|
121
|
+
|
|
122
|
+
> 👍 **Assim que se faz**:
|
|
123
|
+
>
|
|
124
|
+
> Modifique o comportamento por ***breakpoint***, exemplos: `.from-sm-text-lowercase`, `.from-lg-text-uppercase`.
|
|
125
|
+
|
|
126
|
+
## Quebra de linha e truncamento
|
|
127
|
+
|
|
128
|
+
Controla o comportamento do texto quando o espaço disponível é limitado:
|
|
129
|
+
|
|
130
|
+
- `text-wrap`: quebra a linha em espaços e hífens;
|
|
131
|
+
- `text-break`: força a quebra de palavras;
|
|
132
|
+
- `text-nowrap`: impede a quebra de linha;
|
|
133
|
+
- `text-truncate`: adiciona reticências quando o conteúdo excede a largura disponível.
|
|
134
|
+
|
|
135
|
+
### Exemplo de uso
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<p class="text-center text-uppercase font-size-up-1">
|
|
139
|
+
comunicado importante
|
|
140
|
+
</p>
|
|
141
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@govbr-ds/design",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.34",
|
|
4
4
|
"description": "Estilos fundamentais e utilitários do Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -16,18 +16,19 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "
|
|
19
|
+
"url": "https://gitlab.com/govbr-ds/govbr-ds.git",
|
|
20
20
|
"directory": "projects/design"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"author": "SERPRO (http://serpro.gov.br/)",
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
|
+
"docs/**/*.md",
|
|
26
27
|
"src/**/*.scss"
|
|
27
28
|
],
|
|
28
29
|
"devDependencies": {
|
|
29
30
|
"@axe-core/puppeteer": "4.13.0",
|
|
30
|
-
"@govbr-ds/tokens": "4.0.0-next.
|
|
31
|
+
"@govbr-ds/tokens": "4.0.0-next.34",
|
|
31
32
|
"autoprefixer": "10.5.4",
|
|
32
33
|
"css-tree": "3.2.1",
|
|
33
34
|
"cssnano": "8.0.5",
|
package/src/core/_states.scss
CHANGED
|
@@ -1,3 +1,78 @@
|
|
|
1
|
+
// Hover
|
|
2
|
+
.hover {
|
|
3
|
+
background-color: var(--br-state-hover-color-interactive-fg-main);
|
|
4
|
+
transition-timing-function: var(--br-state-hover-easing-in-default);
|
|
5
|
+
transition-duration: var(--br-state-hover-duration-in-default);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Hover especial
|
|
9
|
+
.hover-highlight {
|
|
10
|
+
&:hover,
|
|
11
|
+
&.hover {
|
|
12
|
+
box-shadow: var(--br-state-hover-shadow-style-highlight);
|
|
13
|
+
transform: scale(var(--br-state-hover-size-highlight));
|
|
14
|
+
transition-duration: var(--br-state-hover-duration-in-highlight);
|
|
15
|
+
transition-property: transform;
|
|
16
|
+
transition-timing-function: var(--br-state-hover-easing-in-highlight);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Foco
|
|
21
|
+
.focus {
|
|
22
|
+
outline: var(--br-state-focus-border-style-main-high);
|
|
23
|
+
outline-color: var(--br-state-focus-color-main);
|
|
24
|
+
outline-offset: var(--br-state-focus-padding);
|
|
25
|
+
transition-timing-function: var(--br-state-focus-easing-in);
|
|
26
|
+
transition-duration: var(--br-state-focus-duration-in);
|
|
27
|
+
transition-property: outline-offset;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Pressionado
|
|
31
|
+
.pressed {
|
|
32
|
+
box-shadow: var(--br-state-pressed-shadow-style);
|
|
33
|
+
transition-timing-function: var(--br-state-pressed-easing-in);
|
|
34
|
+
transition-duration: var(--br-state-pressed-duration-in);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Selecionado
|
|
38
|
+
.selected {
|
|
39
|
+
background-color: var(--br-state-selected-color-main);
|
|
40
|
+
color: var(--br-state-selected-color-foreground-main);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Ativo
|
|
44
|
+
.active {
|
|
45
|
+
background-color: var(--br-state-active-color-main);
|
|
46
|
+
color: var(--br-state-active-color-foreground-main);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Ligado
|
|
50
|
+
.on {
|
|
51
|
+
background-color: var(--br-state-on-color-main);
|
|
52
|
+
color: var(--br-state-on-color-foreground-main);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Desligado
|
|
56
|
+
.off {
|
|
57
|
+
background-color: var(--br-state-off-color-main);
|
|
58
|
+
color: var(--br-state-off-color-foreground-main);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Visitado
|
|
62
|
+
.visited {
|
|
63
|
+
color: var(--br-state-visited-color-main);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Call to action
|
|
67
|
+
.cta {
|
|
68
|
+
background-color: var(--br-state-cta-color-main);
|
|
69
|
+
color: var(--br-state-cta-color-foreground-main);
|
|
70
|
+
|
|
71
|
+
&-text {
|
|
72
|
+
color: var(--br-state-cta-color-main);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
1
76
|
// Input, select e textarea
|
|
2
77
|
input:not([type="checkbox"], [type="radio"]),
|
|
3
78
|
select,
|
|
@@ -42,6 +117,7 @@ input[type="radio"] {
|
|
|
42
117
|
outline-color: var(--br-state-focus-color-main);
|
|
43
118
|
transition-timing-function: var(--br-state-focus-easing-in);
|
|
44
119
|
transition-duration: var(--br-state-focus-duration-in);
|
|
120
|
+
transition-property: outline-offset;
|
|
45
121
|
}
|
|
46
122
|
|
|
47
123
|
// Desabilitado
|
|
@@ -59,15 +135,6 @@ input[type="button"],
|
|
|
59
135
|
input[type="submit"],
|
|
60
136
|
input[type="reset"],
|
|
61
137
|
button {
|
|
62
|
-
// Foco
|
|
63
|
-
&:focus-visible {
|
|
64
|
-
outline: var(--br-state-focus-border-style-main-high);
|
|
65
|
-
outline-color: var(--br-state-focus-color-main);
|
|
66
|
-
outline-offset: var(--br-state-focus-padding);
|
|
67
|
-
transition-timing-function: var(--br-state-focus-easing-in);
|
|
68
|
-
transition-duration: var(--br-state-focus-duration-in);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
138
|
// Desabilitado
|
|
72
139
|
&:disabled,
|
|
73
140
|
&[disabled] {
|
|
@@ -82,6 +149,16 @@ button {
|
|
|
82
149
|
transition-timing-function: var(--br-state-hover-easing-out);
|
|
83
150
|
transition-duration: var(--br-state-hover-duration-out);
|
|
84
151
|
|
|
152
|
+
// Foco
|
|
153
|
+
&:focus-visible {
|
|
154
|
+
outline: var(--br-state-focus-border-style-main-high);
|
|
155
|
+
outline-color: var(--br-state-focus-color-main);
|
|
156
|
+
outline-offset: var(--br-state-focus-padding);
|
|
157
|
+
transition-timing-function: var(--br-state-focus-easing-in);
|
|
158
|
+
transition-duration: var(--br-state-focus-duration-in);
|
|
159
|
+
transition-property: outline-offset;
|
|
160
|
+
}
|
|
161
|
+
|
|
85
162
|
// Pressionado
|
|
86
163
|
&:active {
|
|
87
164
|
box-shadow: var(--br-state-pressed-shadow-style);
|
|
@@ -110,6 +187,7 @@ a {
|
|
|
110
187
|
outline-offset: var(--br-state-focus-padding);
|
|
111
188
|
transition-timing-function: var(--br-state-focus-easing-in);
|
|
112
189
|
transition-duration: var(--br-state-focus-duration-in);
|
|
190
|
+
transition-property: outline-offset;
|
|
113
191
|
}
|
|
114
192
|
|
|
115
193
|
// Pressionado
|