@melcanz85/chaincss 1.5.8 → 1.5.10
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 +13 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,18 +32,19 @@ Project Structure
|
|
|
32
32
|
Create this folder structure in your project:
|
|
33
33
|
|
|
34
34
|
your-project/
|
|
35
|
-
├── chaincss/
|
|
36
|
-
│ ├── main.jcss
|
|
37
|
-
│ ├── chain.jcss
|
|
38
|
-
│ └── processor.js
|
|
39
|
-
├── public/
|
|
35
|
+
├── chaincss/ # ChainCSS source files
|
|
36
|
+
│ ├── main.jcss # Main entry file
|
|
37
|
+
│ ├── chain.jcss # Chaining definitions
|
|
38
|
+
│ └── processor.js # Processing script
|
|
39
|
+
├── public/ # Output files
|
|
40
40
|
│ ├── index.html
|
|
41
|
-
│ └── style.css
|
|
41
|
+
│ └── style.css # Generated CSS
|
|
42
42
|
├── node_modules/
|
|
43
43
|
├── package.json
|
|
44
44
|
└── package-lock.json
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
The Initialization processor Setup
|
|
47
48
|
|
|
48
49
|
In chaincss/processor.js:
|
|
49
50
|
|
|
@@ -61,7 +62,9 @@ try {
|
|
|
61
62
|
|
|
62
63
|
--Chaining File (chaincss/chain.jcss):
|
|
63
64
|
|
|
64
|
-
*** This is where the chaining happens all codes here are javascript
|
|
65
|
+
*** This is where the chaining happens all codes here are in javascript syntax, the methods are the css properties but in javascript form it follows the camelCase syntax. Example the property font-family is fontFamily in chaincss and your css selector is the value of the block() method which is always at the end of the chain.
|
|
66
|
+
|
|
67
|
+
*** The property method are the same as the css property but background is an exception because it's a long word so it is shorten to bg only. Example background-color is bgColor() in chaincss etc.
|
|
65
68
|
|
|
66
69
|
// Variables for consistent styling
|
|
67
70
|
const bodyBgColor = '#f0f0f0';
|
|
@@ -135,13 +138,13 @@ module.exports = {
|
|
|
135
138
|
|
|
136
139
|
📝 Notes
|
|
137
140
|
|
|
138
|
-
You can directly put css syntax on your main file.
|
|
141
|
+
You can directly put css syntax code on your main file.
|
|
139
142
|
|
|
140
143
|
But chainCSS syntax must be wrapped in <@ @> delimiters.
|
|
141
144
|
|
|
142
145
|
The get() function imports chaining definitions from other files
|
|
143
146
|
|
|
144
|
-
YOU can modify your style in between get() and compile() in the main file it will
|
|
147
|
+
YOU can modify your style in between get() and compile() in the main file it will overwrite the styles in the chainn file.
|
|
145
148
|
|
|
146
149
|
🎨 Editor Support
|
|
147
150
|
|