@tokens_variables_credix/tokenized-styles 1.0.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/README.md +117 -0
- package/dist/css/tokens.css +2800 -0
- package/dist/scss/1-primitives.scss +443 -0
- package/dist/scss/2-semantic.scss +535 -0
- package/dist/scss/3-component.scss +4650 -0
- package/dist/scss/variables.scss +4 -0
- package/package.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# @tokens_variables_credix/tokenized-styles
|
|
2
|
+
|
|
3
|
+
Design tokens en CSS y SCSS para usar en Angular y otros proyectos.
|
|
4
|
+
|
|
5
|
+
## Estructura del paquete (después de `npm run build`)
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
dist/
|
|
9
|
+
├── css/
|
|
10
|
+
│ └── tokens.css # Variables CSS (--color-primary: #4C7AF2;)
|
|
11
|
+
└── scss/
|
|
12
|
+
│ ├── variables.scss # Punto de entrada SCSS (importa primitives, semantic, component)
|
|
13
|
+
│ ├── 1-primitives.scss
|
|
14
|
+
│ ├── 2-semantic.scss
|
|
15
|
+
│ └── 3-component.scss
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Uso local
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm run build
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Publicar el paquete
|
|
25
|
+
|
|
26
|
+
### 1. Ajustar nombre y registro
|
|
27
|
+
|
|
28
|
+
- Cambia `@tokens_variables_credix` en `package.json` por el scope de tu organización (ej: `@mi-empresa`).
|
|
29
|
+
- Si usas **npm público**: `npm publish --access public` (paquetes con scope son privados por defecto).
|
|
30
|
+
- Si usas **GitHub Packages**: crea `.npmrc` en el repo con:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
@tokens_variables_credix:registry=https://npm.pkg.github.com
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
y en `package.json` añade:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/tu-org/tu-repo.git"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"registry": "https://npm.pkg.github.com"
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 2. Publicar
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm run build
|
|
52
|
+
npm publish
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Consumir en un proyecto Angular
|
|
56
|
+
|
|
57
|
+
### Instalación
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install @tokens_variables_credix/tokenized-styles@latest --save
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### CSS global (angular.json)
|
|
64
|
+
|
|
65
|
+
En `angular.json`, en `projects > tu-proyecto > architect > build > options > styles`:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
"styles": [
|
|
69
|
+
"node_modules/@tokens_variables_credix/tokenized-styles/dist/css/tokens.css",
|
|
70
|
+
"src/styles.css"
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### SCSS en componentes
|
|
75
|
+
|
|
76
|
+
En cualquier `.scss`:
|
|
77
|
+
|
|
78
|
+
```scss
|
|
79
|
+
@use '@tokens_variables_credix/tokenized-styles/dist/scss/variables' as *;
|
|
80
|
+
|
|
81
|
+
.mi-clase {
|
|
82
|
+
color: $colors-rojo-primary-rojo-50;
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
O con namespace:
|
|
87
|
+
|
|
88
|
+
```scss
|
|
89
|
+
@use '@tokens_variables_credix/tokenized-styles/dist/scss/variables' as tokens;
|
|
90
|
+
|
|
91
|
+
.mi-clase {
|
|
92
|
+
color: tokens.$colors-rojo-primary-rojo-50;
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Versionado
|
|
97
|
+
|
|
98
|
+
Usa [Semantic Versioning](https://semver.org/). En el proyecto que consume:
|
|
99
|
+
|
|
100
|
+
- `^1.0.0` → acepta 1.x.x
|
|
101
|
+
- `~1.0.0` → acepta 1.0.x
|
|
102
|
+
|
|
103
|
+
Actualizar tokens en el proyecto:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm update @tokens_variables_credix/tokenized-styles
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/*
|
|
112
|
+
3a00eb5186270602abfe08aa6ce164f8e442bb532879f273a719a1386d688b10
|
|
113
|
+
2d8c10e83380cec168715da0087f153d7e90daea2194cae24a0c6f54a2d7ba2d
|
|
114
|
+
8a24e1c385815e7314eb7140935c06561dd68df053246ab2d827a9ccee270cc4
|
|
115
|
+
8ca26029721bc76bfb3468e241c6a9abd06c202a7346530b59cc93b965b1921c
|
|
116
|
+
412fa6b230122ccfc6fbee107784554bd2f751a0d8757950968cf281e60b0c90
|
|
117
|
+
*/
|