aliascss 1.1.12 → 1.1.13
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 +270 -181
- package/aliascss.config.js +2 -0
- package/dist/aliascss.js +1 -1
- package/lib/css-properties-all.js +16 -1
- package/lib/prefix/responsive.js +2 -0
- package/lib/returnPropertyAndValue.js +13 -0
- package/lib/returnStatement.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
**Welcome to Aliascss!**
|
|
4
4
|
|
|
5
|
-
AliasCSS or in short acss, is a post css processor/compiler means it lets you first define classnames in your html element then get processed to
|
|
5
|
+
AliasCSS or in short acss, is a post css processor/compiler means it lets you first define classnames in your html element then get processed to corresponding css declaration.
|
|
6
|
+
|
|
7
|
+
[https:aliascss.com](Offical Documentation site)
|
|
6
8
|
|
|
7
9
|
## What it is?
|
|
8
10
|
With aliascss you can style you webpages using class attribute with post-define classname, for example
|
|
@@ -13,20 +15,22 @@ OR, using shorthand
|
|
|
13
15
|
```html
|
|
14
16
|
<h1 class="c-red fs-12px dib"> Hello world</h1>
|
|
15
17
|
```
|
|
16
|
-
Here we have defined the color, font size, display properties of h1 element first, then aliascss will compiles and defines the classname with the
|
|
18
|
+
Here we have defined the color, font size, display properties of h1 element first, then aliascss will compiles and defines the classname with the corresponding property and value/s in the styles tag or stylesheets. Generally every aliascss classname hold single property and value for it.
|
|
17
19
|
|
|
18
20
|
## Getting Started
|
|
19
21
|
|
|
20
22
|
### Install
|
|
21
23
|
|
|
22
24
|
### NPM
|
|
23
|
-
```
|
|
24
|
-
npm install aliascss
|
|
25
|
+
```sh copy
|
|
26
|
+
npm install --save-dev aliascss
|
|
25
27
|
```
|
|
26
28
|
|
|
27
29
|
### CDN
|
|
30
|
+
```html copy
|
|
31
|
+
<script defer src="https://cdn.jsdelivr.net/npm/aliascss@latest/dist/aliascss.js"></script>
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
```
|
|
30
34
|
|
|
31
35
|
# Documentation
|
|
32
36
|
If you know CSS then your know already Aliascss. Aliascss let you to apply css directly in the html with the help of post define classname. Let's assume we need to style our h1 element
|
|
@@ -50,7 +54,7 @@ Now , if we want same result using aliascss, then
|
|
|
50
54
|
Or by using full semantic classnames
|
|
51
55
|
|
|
52
56
|
```
|
|
53
|
-
<h1 class="color-gray font-
|
|
57
|
+
<h1 class="color-gray font-size-18px">Hello World!</h1>
|
|
54
58
|
|
|
55
59
|
```
|
|
56
60
|
> Here if you look carefully the classnames is doing dual responsibility. one is defining classnames and second is also defining css declaration for itself. In AliasCSS ecosystem we first use classnames, then the compiler will define classnames and corresponding property and value in the stylesheet/style tag. you don't have to use aliascss compiler in production.
|
|
@@ -60,87 +64,109 @@ Or by using full semantic classnames
|
|
|
60
64
|
|------------------|-------------|--------------------------:|
|
|
61
65
|
|`display-flex`|`df`|`display:flex`|
|
|
62
66
|
|`list-style-none`|`lsn`|`list-style:none`|
|
|
63
|
-
|`margin-left-20px`|`
|
|
64
|
-
|`margin-top
|
|
65
|
-
|`
|
|
67
|
+
|`margin-left-20px`|`ml-20px`|`margin-left:20px`|
|
|
68
|
+
|`margin-top--20px`|`mt--20px`|`margin-top:-20px`|
|
|
69
|
+
|`border-1px-solid-ccc`|`b-1px-s-ccc`|`border:1px solid #ccc`|
|
|
66
70
|
|`backgound-color-10p20p30p`|`bgc-10p20p30p`|`background-color:rgb(10%, 20%, 30%)`|
|
|
67
71
|
|`opacity-1`|`o-1`|`opacity:1`|
|
|
68
72
|
|`opacity-0d5`|`o-0d5`|`opacity:0.5`|
|
|
69
73
|
|
|
70
74
|
|
|
71
75
|
|
|
72
|
-
```There are two ways to use class name, either using shorhand e.g c-red
|
|
76
|
+
```There are two ways to use class name, either using shorhand e.g c-red m-20px df p-20p-30px l-30px OR full semantic class name color-red display-flex padding-20px-30px left-30px```
|
|
73
77
|
|
|
74
|
-
## Selector and
|
|
75
|
-
We can also target
|
|
78
|
+
## Selector and Pseudo [ hover: focus: active: ]
|
|
79
|
+
We can also target pseudo selector / element in your class name by using flags(-- ) e.g --hover or --h. For an example:-
|
|
76
80
|
```
|
|
77
81
|
<div class="bgc-cccccc --hover-bgc-yellow> Hi! i will change background color on hover</div>
|
|
78
82
|
```
|
|
79
|
-
Here by using --hover flag ( *can be used
|
|
83
|
+
Here by using --hover flag ( *can be used --h shorthand flag*) we are telling to use it in :hover state
|
|
80
84
|
|
|
81
85
|
Flags:-
|
|
82
86
|
|
|
83
|
-
| flags |short-flag | corresponding css
|
|
87
|
+
| flags |short-flag | corresponding css selector |
|
|
84
88
|
|-------------|---|---------:|
|
|
85
|
-
|--active
|
|
86
|
-
|--after
|
|
87
|
-
|--after-hover
|
|
88
|
-
|--
|
|
89
|
-
|--
|
|
90
|
-
|--
|
|
91
|
-
|--
|
|
92
|
-
|--
|
|
93
|
-
|--
|
|
94
|
-
|--
|
|
95
|
-
|--
|
|
96
|
-
|--
|
|
97
|
-
|--
|
|
98
|
-
|--
|
|
99
|
-
|--
|
|
100
|
-
|--
|
|
101
|
-
|--
|
|
102
|
-
|--
|
|
103
|
-
|--
|
|
104
|
-
|--
|
|
105
|
-
|--
|
|
106
|
-
|--
|
|
107
|
-
|--
|
|
108
|
-
|--
|
|
109
|
-
|--
|
|
110
|
-
|--
|
|
111
|
-
|--
|
|
112
|
-
|--
|
|
113
|
-
|--
|
|
114
|
-
|--
|
|
115
|
-
|--
|
|
116
|
-
|--
|
|
117
|
-
|--
|
|
118
|
-
|--
|
|
119
|
-
|--
|
|
120
|
-
|--
|
|
121
|
-
|--
|
|
122
|
-
|--
|
|
123
|
-
|--
|
|
124
|
-
|--
|
|
125
|
-
|--
|
|
126
|
-
|--
|
|
127
|
-
|--
|
|
128
|
-
|--
|
|
129
|
-
|--
|
|
130
|
-
|--
|
|
89
|
+
|--active|--a or --ac|:active|
|
|
90
|
+
|--after|--af|::after|
|
|
91
|
+
|--after-hover|--afh|::after:hover|
|
|
92
|
+
|--autofill|--atf|:-webkit-autofill|
|
|
93
|
+
|--anylink|--al|:-webkit-anylink|
|
|
94
|
+
|--backdrop|--bd|::backdrop|
|
|
95
|
+
|--before|--bf|::before|
|
|
96
|
+
|--before-hover|--bfh|::before:hover|
|
|
97
|
+
|--blank|--bl|:blank|
|
|
98
|
+
|--checked|--ch|:checked|
|
|
99
|
+
|--cue|--cu|::cue|
|
|
100
|
+
|--current|--cur|:current|
|
|
101
|
+
|--default|--de|:default|
|
|
102
|
+
|--disabled|--di|:disabled|
|
|
103
|
+
|--empty|--em|:empty|
|
|
104
|
+
|--enabled|--en|:enabled|
|
|
105
|
+
|--first-child|--fc|:first-child|
|
|
106
|
+
|--first-letter|--fl|::first-letter|
|
|
107
|
+
|--first-line|--fln|::first-line|
|
|
108
|
+
|--first-of-type |--fot|:first-of-type|
|
|
109
|
+
|--focus| --f or --fo|:focus|
|
|
110
|
+
|--focus-within| --fw|:focus-within|
|
|
111
|
+
|--focus-visible| --fv|:focus-visible|
|
|
112
|
+
|--file-selector-button| --fsb |::file-selector-button|
|
|
113
|
+
|--fullscreen| --fs |::fullscreen|
|
|
114
|
+
|--hover|--h or --ho|:hover|
|
|
115
|
+
|--has|--hs|:has|
|
|
116
|
+
|--hover-after|--haf|:hover::after|
|
|
117
|
+
|--hover-before|--hbf|:hover::before|
|
|
118
|
+
|--hover-target|--htg|:hover:target|
|
|
119
|
+
|--in-range|--ir|:in-range|
|
|
120
|
+
|--indeterminate|--ind|:indeterminate|
|
|
121
|
+
|--invalid|--inv|:invalid|
|
|
122
|
+
|--is|--is|:is|
|
|
123
|
+
|--lang|--lan|:lang|
|
|
124
|
+
|--last-child|--lc|:last-child|
|
|
125
|
+
|--last-of-type|--lot|:last-of-type|
|
|
126
|
+
|--link|--ln or -l|:link|
|
|
127
|
+
|--not-|--n-|:not|
|
|
128
|
+
|--nth-child-|--nc-|:nth-child|
|
|
129
|
+
|--nth-last-child-|--nlc-|:nth-last-child|
|
|
130
|
+
|--nth-last-of-type-|--nlot-|:nth-last-of-type|
|
|
131
|
+
|--nth-of-type-|--nthot-|:nth-of-type|
|
|
132
|
+
|--marker|--m|:marker|
|
|
133
|
+
|--only-of-type |--oot|:only-of-type|
|
|
134
|
+
|--only-child|--oc|:only-child|
|
|
135
|
+
|--optional|--op|:optional|
|
|
136
|
+
|--out-of-range|--oor|:out-of-range|
|
|
137
|
+
|--placeholder|--ph|::placeholder|
|
|
138
|
+
|--placeholder-shadow|--phs|::placeholder-shadow|
|
|
139
|
+
|--popover-open|--po|:popover-open|
|
|
140
|
+
|--read-only |--ro|:read-only|
|
|
141
|
+
|--read-write|--rw|:read-write|
|
|
142
|
+
|--required|--rq|:required|
|
|
143
|
+
|--root|--rt|:root|
|
|
144
|
+
|--selection|--s|::selection|
|
|
145
|
+
|--scrollbar|--sb|::-webkit-scrollbar|
|
|
146
|
+
|--webkit-scrollbar|--sb|::-webkit-scrollbar|
|
|
147
|
+
|--scrollbar-track|--st|::-webkit-scrollbar-track|
|
|
148
|
+
|--webkit-scrollbar-track|--st|::-webkit-scrollbar-track|
|
|
149
|
+
|--scrollbar-thumb|--stm|::-webkit-scrollbar-thumb|
|
|
150
|
+
|--webkit-scrollbar-thumb|--stm|::-webkit-scrollbar-thumb|
|
|
151
|
+
|--spelling-error|--se|::spelling-error|
|
|
152
|
+
|--target |--tg|:target|
|
|
153
|
+
|--user-invalid |--ui|:user-invalid|
|
|
154
|
+
|--valid|--va|:valid|
|
|
155
|
+
|--visited|--vi or- -v|:visited|
|
|
156
|
+
|--where|--w|:where|
|
|
131
157
|
|
|
132
158
|
**Examples**
|
|
133
159
|
|
|
134
160
|
| classname |shorthand | css |Remarks|
|
|
135
161
|
|----------- |----------- |----------------------|------------|
|
|
136
|
-
|`--hover-display-flex
|
|
137
|
-
|`--focus-list-style-none
|
|
138
|
-
|`--nth-child-2n-margin-
|
|
162
|
+
|`--hover-display-flex`|`--h-df`|`:hover{display: flex ;}`|
|
|
163
|
+
|`--focus-list-style-none`|`--fo-lsn`|`:focus{list-style:none;}`|
|
|
164
|
+
|`--nth-child-2n-margin-left-20px`|`--nc-2n-ml-20px`|`:nth-child(2n){margin-left:20px ;}`|
|
|
139
165
|
|
|
140
166
|
|
|
141
|
-
####
|
|
167
|
+
#### Similarly , we can also tell aliascss classname to use selector by using '_' at the begin-ing class name . eg:-
|
|
142
168
|
```
|
|
143
|
-
<div class="_h3-c-white _p-
|
|
169
|
+
<div class="_h3-c-white _p-fs-14px"" >
|
|
144
170
|
<h3>Hello World</h3>
|
|
145
171
|
<p> Welcome to AliasCSS </p>
|
|
146
172
|
</div>\
|
|
@@ -172,7 +198,7 @@ Or by using full semantic classnames
|
|
|
172
198
|
|
|
173
199
|
To target Device , we can simply add device prefix at the very begening of classname. for eg:-
|
|
174
200
|
```
|
|
175
|
-
<p class="xs-dn">This will not show in
|
|
201
|
+
<p class="xs-dn">This will not show in smaller device</p>
|
|
176
202
|
```
|
|
177
203
|
or using semantic classname
|
|
178
204
|
```
|
|
@@ -182,20 +208,21 @@ or using semantic classname
|
|
|
182
208
|
#### Device Guide Table
|
|
183
209
|
|AliasCSS Device Prefix| CSS Selector|
|
|
184
210
|
|--|--|
|
|
185
|
-
|mob|@media (max-width : 768px) |
|
|
186
|
-
|mobile|@media (max-width : 768px) |
|
|
187
|
-
|tab|@media (min-width : 768px)|
|
|
188
|
-
|lab|@media (min-width : 992px) |
|
|
189
|
-
|desk|@media (min-width : 1200px) |
|
|
190
|
-
|hd|@media (min-width : 1408px) |
|
|
191
211
|
|print|@media print|
|
|
192
212
|
|xs|@media (max-width : 576px) |
|
|
193
213
|
|sm|@media (min-width : 576px) |
|
|
194
214
|
|md|@media (min-width : 768px) |
|
|
195
215
|
|lg|@media (min-width : 992px) |
|
|
196
216
|
|xl|@media (min-width : 1200px)|
|
|
197
|
-
|
|
198
|
-
|
|
217
|
+
|xxl|@media (min-width : 1408px) |
|
|
218
|
+
|-xs| @media (min-width : 576px) |
|
|
219
|
+
|-sm|@media (max-width : 576px) |
|
|
220
|
+
|-md|@media (max-width : 768px) |
|
|
221
|
+
|-lg|@media (max-width : 992px) |
|
|
222
|
+
|-xl|@media (max-width : 1200px)|
|
|
223
|
+
|-xxl|@media (max-width : 1408px) |
|
|
224
|
+
|
|
225
|
+
>Any of the above prefix can be used, these prefix must be the at the begin-ing of the classnames.
|
|
199
226
|
Few examples:-
|
|
200
227
|
|
|
201
228
|
**Define**
|
|
@@ -208,7 +235,7 @@ Few examples:-
|
|
|
208
235
|
**Compiled**
|
|
209
236
|
```
|
|
210
237
|
@media (max-width : 768px) {
|
|
211
|
-
.
|
|
238
|
+
.xs-flex-direction-column{
|
|
212
239
|
flex-direction: column ;
|
|
213
240
|
}
|
|
214
241
|
}
|
|
@@ -230,23 +257,23 @@ Few examples:-
|
|
|
230
257
|
```
|
|
231
258
|
**Define**
|
|
232
259
|
```
|
|
233
|
-
<div class="
|
|
234
|
-
//using shorthand <div class="
|
|
260
|
+
<div class="md-width500px">...</div>
|
|
261
|
+
//using shorthand <div class="md-w500p">...</div>
|
|
235
262
|
```
|
|
236
263
|
|
|
237
264
|
**Compiled**
|
|
238
265
|
```
|
|
239
266
|
@media (min-width : 768px){
|
|
240
|
-
.
|
|
267
|
+
.md-width500px{
|
|
241
268
|
width:500px ;
|
|
242
269
|
}
|
|
243
270
|
}
|
|
244
271
|
```
|
|
245
272
|
|
|
246
273
|
|
|
247
|
-
# Classname
|
|
274
|
+
# Classname Definition Guide
|
|
248
275
|
##### Rules for defining classnames
|
|
249
|
-
- In general every aliasCSS classnames are derived from css property and value we want to apply.i.e display-flex, color-red,
|
|
276
|
+
- In general every aliasCSS classnames are derived from css property and value we want to apply.i.e display-flex, color-red, width-100px, margin-left2rem etc, similarly short-hand classnames are also derived for first letter of property followed by every first letter after '-'followed by first letter of value and every first letter after '-' if it has any.
|
|
250
277
|
For Example
|
|
251
278
|
```
|
|
252
279
|
display:flex => df or display-flex
|
|
@@ -255,15 +282,15 @@ animation-timing-function: ease-in-out => atfeio or animation-timing-function-ea
|
|
|
255
282
|
width:100px => w100px or width100px
|
|
256
283
|
width:-100px => w-100px or width-100px
|
|
257
284
|
```
|
|
258
|
-
> if there is '-' in classname before length or numeric unit it will treated as negative value. e.g w100px => width:100px , w-100px =>width
|
|
259
|
-
-
|
|
285
|
+
> if there is '-' in classname before length or numeric unit it will treated as negative value. e.g w100px => width:100px , w-100px =>width:100px , margin-100px=> margin:100px, margin--100px => margin:-110px, fs-12px => font-size:-12px; fs-12px=> font-size:12px; Be care full when using '-' before numeric value.
|
|
286
|
+
- Replace "." with d and "%" with p, note this only applicable to numeric and length unit . "d" must be between two numeric value. i.e d5 not != .5, use 0d5 => 0.5
|
|
260
287
|
|
|
261
288
|
|Acss|shorthand|Css|
|
|
262
289
|
|--|--|--|
|
|
263
|
-
|`
|
|
264
|
-
|`margin
|
|
265
|
-
|`
|
|
266
|
-
|`
|
|
290
|
+
|`margin-0d75rem`|`m-0d75rem`|`margin:0.75rem`|
|
|
291
|
+
|`margin--0d75rem`|`m--0d75rem`|`margin:-0.75rem`|
|
|
292
|
+
|`width-50p`|` w-50p`|`width:50%`|
|
|
293
|
+
|`opacity-0d5`|`o-0d5`|`opacity:0.5`|
|
|
267
294
|
|
|
268
295
|
|
|
269
296
|
|
|
@@ -272,16 +299,16 @@ width:-100px => w-100px or width-100px
|
|
|
272
299
|
|
|
273
300
|
| classname |shorthand | css |Remarks|
|
|
274
301
|
|----------- |----------- |----------------------|------------|
|
|
275
|
-
|`
|
|
276
|
-
|`
|
|
277
|
-
|`
|
|
278
|
-
|`
|
|
279
|
-
|`
|
|
280
|
-
|`margin-
|
|
302
|
+
|`margin-100px`|`m-100px` | `margin:100px` | |
|
|
303
|
+
|`margin-1em` |`m-1em` |`margin:1em`|
|
|
304
|
+
|`margin-50p` |`m-50p` |`margin:50%` | Use 'p' for %|
|
|
305
|
+
|`margin-0d5rem`|`m-0d5rem` |`margin:0.5rem` | use 'd' for .|
|
|
306
|
+
|`margin-20px-30px-20px-40px`|`m-20px-30px-20px-40px`|` margin:20px 30px 20px 40px`|
|
|
307
|
+
|`margin--20px-30px--20px-40px`|`m--20px-30px--20px-40px`| `margin:-20px 30px -20px 40px`|
|
|
281
308
|
|`margin-left150px`|`ml150px`|`margin-left:150px`|
|
|
282
|
-
|`border-
|
|
283
|
-
|`max-
|
|
284
|
-
|`min-
|
|
309
|
+
|`border-radius-15px`|`br-15px`|`border-radius:15px`|
|
|
310
|
+
|`max-width-500px`|`xw-500px`|`max-width:500px`|
|
|
311
|
+
|`min-width-300px`|`mw-300p`|`min-width:300px`|
|
|
285
312
|
---
|
|
286
313
|
## Color
|
|
287
314
|
### Color by name and Hexadecimal value
|
|
@@ -302,7 +329,7 @@ or,
|
|
|
302
329
|
|
|
303
330
|
`syntax:[color|c]-[0-100]p[0-100]p[00-100]p`
|
|
304
331
|
> RGB is represented by 3 digit [000-255] for each R G and B value, Incase of percentage 'p' should be used to represent '%'.
|
|
305
|
-
Alpha can be represent by either decimal or percentage value, 'd' should be used in
|
|
332
|
+
Alpha can be represent by either decimal or percentage value, 'd' should be used in place of ' . '.
|
|
306
333
|
|
|
307
334
|
|
|
308
335
|
|
|
@@ -329,28 +356,28 @@ Alpha can be represent by either decimal or percentage value, 'd' should be used
|
|
|
329
356
|
#### `border`
|
|
330
357
|
|classname|shorthand|css|Remarks|
|
|
331
358
|
|---------|---------|---|-------|
|
|
332
|
-
|`
|
|
333
|
-
|`
|
|
334
|
-
|`border-
|
|
359
|
+
|`border-1px-solid-red`|`b-1px-s-red`|`border:1px solid red`|
|
|
360
|
+
|`border-1px-solid-30p40p50p`|`b-2px-s-30p40p50p`|`border:1px solid rgb(30%,40%,50%)`|
|
|
361
|
+
|`border-bottom-2px-dashed-cccccc`|`bb-2px-ds-cccccc`|`border-bottom:2px dashed #cccccc`|
|
|
335
362
|
|
|
336
363
|
#### `border-radius`
|
|
337
364
|
|
|
338
365
|
|classname|shorthand|css|Remarks|
|
|
339
366
|
|---------|---------|---|-------|
|
|
340
|
-
|`border-
|
|
341
|
-
|`border-
|
|
342
|
-
|`border-
|
|
343
|
-
|`border-bottom-left-
|
|
344
|
-
|`border-top-right-
|
|
367
|
+
|`border-radius-5px`|`br-5px`|`border-radius:5px`|
|
|
368
|
+
|`border-radius-10px-5px`|`br-10px-5px`|`border-radius:10px 5px`|
|
|
369
|
+
|`border-radius-5px-10px-30px-4px`|`br-5px-10px-30px-4px`|`border-radius:4px 10px 30px 4px`|
|
|
370
|
+
|`border-bottom-left-radius-5px-60px`|`bblr-5px-60px`|` border-bottom-left-radius:5px 60px ;`|
|
|
371
|
+
|`border-top-right-radius-6p`|`btrr-6p`|` border-top-right-radius:6% ;`|
|
|
345
372
|
|
|
346
373
|
#### `box-shadow`
|
|
347
374
|
|
|
348
375
|
|classname|shorthand|css|Remarks|
|
|
349
376
|
|---------|---------|---|-------|
|
|
350
|
-
|`box-
|
|
351
|
-
|`box-
|
|
352
|
-
|`box-shadow
|
|
353
|
-
|`box-
|
|
377
|
+
|`box-shadow-1px2px3px4px-pink`|`bxs-1px-2px-3px-4px-pink`|`box-shadow:1px 2px 3px 4px pink`|
|
|
378
|
+
|`box-shadow-0px-2px-000000000`|`bxs-0px-2px-000000000`|`box-shadow:0px 2px rgb(000,000,000)`|
|
|
379
|
+
|`box-shadow--2px--2px-cccccc`|`bxs--2px--2px-cccccc`|`box-shadow:-2px -2px #cccccc`|
|
|
380
|
+
|`box-shadow-0px-2px-0px-000000000__2px-5px-1px-red`|`bxs-0px-2px-0px-000000000__2px-5px-1px-red`|`box-shadow:0px 2px 0px rgb(000,000,000),2px 5px 1px red`|Multiple value for Box-shadow|
|
|
354
381
|
---
|
|
355
382
|
## Fonts
|
|
356
383
|
|classname|shorthand|css|Remarks|
|
|
@@ -364,71 +391,73 @@ Alpha can be represent by either decimal or percentage value, 'd' should be used
|
|
|
364
391
|
## Transform
|
|
365
392
|
|classname|shorthand|css|Remarks|
|
|
366
393
|
|---------|---------|---|-------|
|
|
367
|
-
|`transform-
|
|
368
|
-
|`transform-
|
|
369
|
-
|`transform-
|
|
370
|
-
|`transform-
|
|
371
|
-
|`transform-
|
|
372
|
-
|`transform-
|
|
373
|
-
|`transform-
|
|
374
|
-
|`transform:-
|
|
375
|
-
|`transform-
|
|
376
|
-
|`transform-
|
|
377
|
-
|`transform-
|
|
378
|
-
|`transform-
|
|
394
|
+
|`transform-rotate-45deg`|`tf-r-45deg`|`transform:rotate(45deg)`|
|
|
395
|
+
|`transform-scale-2__rotate-25deg`|`tf-s2__r-25deg`|`transform:scale(2) rotate(25deg)`| Multiple value|
|
|
396
|
+
|`transform-rotate--45deg`|`tf-r--45deg`|`transform:rotate(-45deg)`|
|
|
397
|
+
|`transform-rotate3d-1--1-1-45deg`|`tf-r3d-1--1-1-45deg`|`transform:rotate3d(1, -1, 1, 45deg)`|
|
|
398
|
+
|`transform-matrix-0d8-0d7--0d8-0.866-0-0`|`tf-m-0d8-0d7--0d8-0.866-0-0`|`transform:matrix(0.8, 0.7, -0.8, 0.866, 0, 0)`||
|
|
399
|
+
|`transform-rotateX-45deg`|`tf-rx-45deg`|`transform:rotateX(45deg)`|
|
|
400
|
+
|`transform-rotate-45deg`|`tf-r-45deg`|`transform:rotate(45deg)`|
|
|
401
|
+
|`transform:-scaleX-2`|`tf-sx-2`|`transform:scaleX(2)`|
|
|
402
|
+
|`transform-skew-45deg--45deg`|`tf-sk-45deg--45deg`|`transform:skew(45deg, -45deg)`|
|
|
403
|
+
|`transform-translate-20px-10px`|`tf-t-20px-10px`|`transform:translate(20px, 10px)`|
|
|
404
|
+
|`transform-rotate-45deg`|`tf-r-45deg`|`transform:rotate(45deg)`|
|
|
405
|
+
|`transform-rotate-45deg`|`tf-r-45deg`|`transform:rotate(45deg)`|
|
|
379
406
|
|
|
380
407
|
## Transition
|
|
381
408
|
|
|
382
409
|
|classname|shorthand|css|Remarks|
|
|
383
410
|
|---------|---------|---|-------|
|
|
384
|
-
|`transition-
|
|
385
|
-
|`transition-
|
|
386
|
-
|`transition-width-0d35s`|`tn-width-0d35s` |`transition:width 0.5s`|
|
|
387
|
-
|`transition-
|
|
411
|
+
|`transition-all-0d5s`|`tn-all-0d5s` |`transition:all 0.5s`|
|
|
412
|
+
|`transition-width-0d35s`|`tn-width-0d35s` |`transition:width 0.5s`|
|
|
413
|
+
|`transition-width-0d35s`|`tn-width-0d35s` |`transition:width 0.5s`|
|
|
414
|
+
|`transition-transform-0d35s`|`tn-transform-0d35s`|`transition:transform 0.35s`|
|
|
388
415
|
|
|
389
416
|
## Filter
|
|
390
417
|
|
|
391
418
|
|classname|shorthand|css|Remarks|
|
|
392
419
|
|---------|---------|---|-------|
|
|
393
|
-
|`filter-
|
|
420
|
+
|`filter-blur-4px`|`fl-b-4px`|`filter:blur(4px)`||
|
|
394
421
|
|`filter-unset`|`flu`|`fliter:unset`||
|
|
395
|
-
|`filter-
|
|
422
|
+
|`filter-brightness-50p__blur-4px__invert-50p`|`fl-br-50p__b-4px__i-50p`|`filter:brightness( 50% ) blur( 4px ) invert( 50% )` |
|
|
396
423
|
|`filter-drop-shadow8px8px10px-gray`|`fl-ds8px8px10px-gray`|`filter:drop-shadow( 8px 8px 10px gray )`||
|
|
397
|
-
|`filter-hue-
|
|
424
|
+
|`filter-hue-rotate-40deg`|`fl-hr-40deg`|`filter:hue-rotate( 40deg )`||
|
|
398
425
|
|
|
399
426
|
## Gradient
|
|
400
427
|
|classname|shorthand|css|Remarks|
|
|
401
428
|
|---------|---------|---|-------|
|
|
402
429
|
|`background-linear-gradient-red-blue`|`bg-lg-red-blue `|`background:linear-gradient( red, blue ) `||
|
|
403
|
-
|`background-linear-gradient-
|
|
404
|
-
|`background-repeating-linear-gradient-
|
|
405
|
-
|`background-linear-gradient-to-right-
|
|
406
|
-
|`background-linear-gradient45deg-
|
|
407
|
-
|`background-radial-gradient-
|
|
408
|
-
|`background-repeating-radial-gradient-circle-
|
|
430
|
+
|`background-linear-gradient-red-10p-blue-90p`|`bg-lg-red-10p-blue-20p `|`background:linear-gradient( red 10%, blue 90% )`||
|
|
431
|
+
|`background-repeating-linear-gradient-red-10p-blue-90p`|`bg-rlg-red-10p-blue-20p `|`background:repeating-linear-gradient( red 10%, blue 90% )`||
|
|
432
|
+
|`background-linear-gradient-to-right-red-10p-blue-90p`|`bg-lg-tr-red-10p-blue-90p `|`background:linear-gradient(to right, red 10%, blue 90% )`||
|
|
433
|
+
|`background-linear-gradient45deg-red-10p-blue-90p`|`bg-lg45deg-red-10p-blue-90p `|`background:linear-gradient(45deg, red 10%, blue 90% )`||
|
|
434
|
+
|`background-radial-gradient-red-10p-blue-90p`|`bg-rg-red-10p-blue-90p `|`background:radial-gradient( red 10%, blue 90% )`||
|
|
435
|
+
|`background-repeating-radial-gradient-circle-blue-5p-skyblue-23p `|`bg-rrg-circle-blue-5p-skyblue-23p `|`background:repeating-radial-gradient( circle, blue 5%, skyblue 23% )`||
|
|
409
436
|
|`background-conic-gradient-red-blue`|`bg-cg-red-blue `|`background:conic-gradient( red, blue ) `||
|
|
437
|
+
|`background-linear-gradient-top-right-red-10p-blue-90p__radial-gradient-center-yellow-blue`|`bg-lg-tr-red-10p-blue-90p__rg-center-yellow-blue `|`background:linear-gradient(top right, red 10%, blue 90% ),radial-gradient( center, yellow, blue )`|multiple|
|
|
410
438
|
|
|
411
439
|
## CSS Variable
|
|
412
440
|
|classname|shorthand|css|Remarks|
|
|
413
441
|
|---------|---------|---|-------|
|
|
414
442
|
|`color--var--name`|`c--var--name`|`color: var(--name)`|
|
|
415
|
-
|`
|
|
443
|
+
|`color--name`|`c--name`|`color: var(--name)`|
|
|
444
|
+
|`width--side-bar-width`|`w--side-bar-width`| `width: var(--side-bar-width)`||
|
|
416
445
|
|
|
417
446
|
|
|
418
447
|
# NPM Guide
|
|
419
448
|
|
|
420
449
|
With `npm` version there are lots of exrta front-end / workflow feature we can use out of the box.
|
|
421
450
|
|
|
422
|
-
`npm
|
|
451
|
+
`npm install --save-dev aliascss`
|
|
423
452
|
|
|
424
453
|
|
|
425
454
|
To Compiler folder from command line
|
|
426
455
|
|
|
427
|
-
`npx aliascss 'public/*.html' 'public/css/acss.
|
|
456
|
+
`npx aliascss 'public/*.html' 'public/css/acss.css'`
|
|
428
457
|
|
|
429
458
|
> output css file must be there if not it should be created manully.
|
|
430
459
|
|
|
431
|
-
>Guide-`npx
|
|
460
|
+
>Guide-`npx aliascss 'input/glob-pattern/**.*' 'path/to/output/style.css'`
|
|
432
461
|
|
|
433
462
|
### Watch for files
|
|
434
463
|
|
|
@@ -446,74 +475,133 @@ To Compiler folder from command line
|
|
|
446
475
|
|
|
447
476
|
```
|
|
448
477
|
|
|
449
|
-
##
|
|
450
|
-
|
|
478
|
+
## aliascss.config.js
|
|
479
|
+
`aliascss.config.js` gives you more feature and power to the workflow.
|
|
451
480
|
|
|
452
|
-
@.aliascss.config.js
|
|
453
481
|
|
|
454
|
-
Basic structure of config file
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
input
|
|
482
|
+
Basic structure of aliascss.config.js file
|
|
483
|
+
|
|
484
|
+
```javascript copy showLineNumbers filename="aliascss.config.js"
|
|
485
|
+
const config= {
|
|
486
|
+
// input glob pattern or array of glob pattern
|
|
487
|
+
input:['app/**/*.(tsx|jsx)', 'components/**/*.(tsx|jsx)','public/*.html'],
|
|
488
|
+
|
|
489
|
+
// Output css file , file must exist or should be created manully if file doesnot exist
|
|
490
|
+
output:{
|
|
491
|
+
// path to main/master css file which include every compiled css declaration for given input
|
|
492
|
+
location:'./public/css/acss.css',
|
|
493
|
+
"--file":true// output css file for each file
|
|
494
|
+
},
|
|
495
|
+
|
|
496
|
+
//---------------Below this are all optional -------------------------
|
|
497
|
+
// Customize media prefix selector
|
|
498
|
+
media:{
|
|
499
|
+
prefix:{
|
|
500
|
+
xs:'@media (max-width : 600px)'
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
// support for css Module
|
|
504
|
+
'--module':true,
|
|
505
|
+
|
|
506
|
+
// import module as i.e import x form 'page.module.css'
|
|
507
|
+
importModuleAs:'x',
|
|
508
|
+
|
|
509
|
+
// uncomment minify is true if you want main css file to be minified by cssnano
|
|
510
|
+
|
|
511
|
+
// minify:true,
|
|
459
512
|
|
|
460
|
-
//
|
|
461
|
-
|
|
513
|
+
// name of extractorFunction
|
|
514
|
+
extractorFunction:"x",
|
|
515
|
+
|
|
516
|
+
// prefix aliascss ac-bgc-red ac--hover-color-red
|
|
517
|
+
// prefix:'ac',
|
|
462
518
|
|
|
463
519
|
//Truncate the css file , you should let it true unless you know what your are doing
|
|
464
520
|
truncate:true,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
//
|
|
521
|
+
|
|
522
|
+
//ADD Custom color Value
|
|
468
523
|
custom:{
|
|
469
|
-
|
|
524
|
+
colors:{
|
|
525
|
+
//custom name for color value must not have "-" or "_" to work perfectly.
|
|
470
526
|
'main':"rgb(12,23,45)",// now you can use bgc-main
|
|
471
527
|
'theme':'#c6c6c6'
|
|
472
528
|
|
|
473
|
-
},
|
|
474
|
-
length:{
|
|
475
|
-
'1cv':'25%'
|
|
476
529
|
}
|
|
477
530
|
|
|
478
531
|
},
|
|
479
|
-
//
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
532
|
+
// Create your own compiler
|
|
533
|
+
extend:{
|
|
534
|
+
'font-size':{
|
|
535
|
+
alias:'fs',
|
|
536
|
+
values:["2rem:xl"],
|
|
537
|
+
compiler:(value)=>{
|
|
538
|
+
return value;
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
'txt-color':{
|
|
542
|
+
proerty:'color',
|
|
543
|
+
extend:'color' // now you can use txt-color in place color
|
|
544
|
+
},
|
|
545
|
+
|
|
546
|
+
// Now you can use shadow as className property e.g shadow-xs
|
|
547
|
+
'shadow':{
|
|
548
|
+
property:'box-shadow',
|
|
549
|
+
compiler:(value)=>{
|
|
550
|
+
value=value.slice(1);
|
|
551
|
+
const values={
|
|
552
|
+
'3xl': ' 0px 32px 64px -12px var(--shadow-color)',
|
|
553
|
+
'xxxl': ' 0px 32px 64px -12px var(--shadow-color)',
|
|
554
|
+
'2xl': ' 0px 24px 48px -12px var(--shadow-color)',
|
|
555
|
+
'xxl': ' 0px 24px 48px -12px var(--shadow-color)',
|
|
556
|
+
'xl': ' 0px 20px 24px -4px var(--shadow-color)',
|
|
557
|
+
'lg': ' 0px 12px 16px -4px var(--shadow-color)',
|
|
558
|
+
'md': ' 0px 4px 8px -2px var(--shadow-color)',
|
|
559
|
+
'sm': ' 0px 1px 3px var(--shadow-color)',
|
|
560
|
+
'xs': ' 0px 1px 2px var(--shadow-color)',
|
|
561
|
+
};
|
|
562
|
+
if(values.hasOwnProperty(value)) return values[value];
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
// predefine className
|
|
568
|
+
prebuild:{
|
|
569
|
+
|
|
570
|
+
'text-xl': 'font-size:20px;line-height:30px',
|
|
571
|
+
'text-lg': 'font-size:18px;line-height:28px',
|
|
572
|
+
'text-md': 'font-size:16px;line-height:24px',
|
|
573
|
+
'text-sm': 'font-size:14px;line-height:20px',
|
|
574
|
+
'text-xs': 'font-size:12px;line-height:18px',
|
|
575
|
+
|
|
576
|
+
'radius-xs':'border-radius:4px',
|
|
577
|
+
|
|
578
|
+
'flex-center':'display:flex;align-items:center;justify-content:center',
|
|
579
|
+
},
|
|
580
|
+
//Add some css statement in every compiled css file
|
|
486
581
|
statement:`
|
|
487
582
|
:root{
|
|
488
|
-
--bg-color:
|
|
583
|
+
--bg-dark-color:rgba(111,111,111,1) ;
|
|
584
|
+
--bg-light-color:rgba(21,21,21,1) ;
|
|
489
585
|
--outline-color:blue;
|
|
490
|
-
|
|
491
|
-
--col-2:calc(var(--col-1)*2)
|
|
492
|
-
--col-3:calc(var(--col-1)*3)
|
|
493
|
-
--col-4:calc(var(--col-1)*4)
|
|
494
|
-
--col-5:calc(var(--col-1)*5)
|
|
495
|
-
--col-6:50%
|
|
496
|
-
--col-8:calc(var(--col-1)*8)
|
|
497
|
-
--col-12:100*
|
|
586
|
+
|
|
498
587
|
}
|
|
499
588
|
|
|
500
589
|
body{
|
|
501
|
-
font:BlinkMacSystemFont , -apple-system , "Segoe UI"
|
|
590
|
+
font-family:BlinkMacSystemFont , -apple-system , "Segoe UI" ;
|
|
502
591
|
}
|
|
503
592
|
|
|
504
593
|
`,
|
|
505
594
|
|
|
506
|
-
// group
|
|
595
|
+
// pre group valid Aliascss classNames in single className
|
|
507
596
|
group:{
|
|
508
|
-
'container':'
|
|
509
|
-
'
|
|
597
|
+
'container':' df fdc bsbb aic flex-shrink-1 flex-grow-1 ',
|
|
598
|
+
'section':'flex-shrink0 bsbb'
|
|
510
599
|
},
|
|
511
|
-
//if some of the
|
|
512
|
-
//You wanna tell
|
|
513
|
-
ignore:['fs12px', 'c-red']
|
|
514
|
-
|
|
515
|
-
|
|
600
|
+
// if some of the className collide with other CSS framework like bootstrap and tailwindcss
|
|
601
|
+
// You wanna tell aliascss to ignore it...
|
|
602
|
+
ignore:['fs12px', 'c-red'],// these classnames will be ignored
|
|
516
603
|
}
|
|
604
|
+
export default config;
|
|
517
605
|
```
|
|
518
606
|
|
|
519
607
|
Now you can do,
|
|
@@ -525,7 +613,8 @@ Now you can do,
|
|
|
525
613
|
`npx aliascss --config --watch`
|
|
526
614
|
|
|
527
615
|
@package.json
|
|
528
|
-
|
|
616
|
+
|
|
617
|
+
```JSON
|
|
529
618
|
....
|
|
530
619
|
"scripts": {
|
|
531
620
|
...
|
|
@@ -536,7 +625,7 @@ Now you can do,
|
|
|
536
625
|
|
|
537
626
|
```
|
|
538
627
|
|
|
539
|
-
|
|
628
|
+
Visit for more..[https:aliascss.com](Offical Documentation site)
|
|
540
629
|
|
|
541
630
|
|
|
542
631
|
|