jac-client 0.2.3__py3-none-any.whl → 0.2.8__py3-none-any.whl

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.
Files changed (224) hide show
  1. jac_client/examples/all-in-one/app.jac +494 -347
  2. jac_client/examples/all-in-one/assets/workers/worker.py +5 -0
  3. jac_client/examples/all-in-one/button.jac +1 -1
  4. jac_client/examples/all-in-one/components/CategoryFilter.jac +35 -0
  5. jac_client/examples/all-in-one/components/Header.jac +13 -0
  6. jac_client/examples/all-in-one/components/ProfitOverview.jac +50 -0
  7. jac_client/examples/all-in-one/components/Summary.jac +53 -0
  8. jac_client/examples/all-in-one/components/TransactionForm.jac +158 -0
  9. jac_client/examples/all-in-one/components/TransactionItem.jac +55 -0
  10. jac_client/examples/all-in-one/components/TransactionList.jac +37 -0
  11. jac_client/examples/all-in-one/components/button.jac +1 -1
  12. jac_client/examples/all-in-one/components/navigation.jac +132 -0
  13. jac_client/examples/all-in-one/constants/categories.jac +37 -0
  14. jac_client/examples/all-in-one/constants/clients.jac +13 -0
  15. jac_client/examples/all-in-one/context/BudgetContext.jac +28 -0
  16. jac_client/examples/all-in-one/hooks/useBudget.jac +116 -0
  17. jac_client/examples/all-in-one/hooks/useLocalStorage.jac +36 -0
  18. jac_client/examples/all-in-one/pages/BudgetPlanner.cl.jac +70 -0
  19. jac_client/examples/all-in-one/pages/BudgetPlanner.jac +126 -0
  20. jac_client/examples/all-in-one/pages/FeaturesTest.cl.jac +552 -0
  21. jac_client/examples/all-in-one/pages/FeaturesTest.jac +126 -0
  22. jac_client/examples/all-in-one/pages/LandingPage.jac +101 -0
  23. jac_client/examples/all-in-one/pages/loginPage.jac +132 -0
  24. jac_client/examples/all-in-one/pages/nestedDemo.jac +61 -0
  25. jac_client/examples/all-in-one/pages/notFound.jac +24 -0
  26. jac_client/examples/all-in-one/pages/signupPage.jac +133 -0
  27. jac_client/examples/all-in-one/utils/formatters.jac +52 -0
  28. jac_client/examples/asset-serving/css-with-image/{app.jac → src/app.jac} +4 -4
  29. jac_client/examples/asset-serving/image-asset/{app.jac → src/app.jac} +4 -4
  30. jac_client/examples/asset-serving/import-alias/{app.jac → src/app.jac} +5 -5
  31. jac_client/examples/basic/{app.jac → src/app.jac} +4 -4
  32. jac_client/examples/basic-auth/src/app.jac +371 -0
  33. jac_client/examples/basic-auth-with-router/{app.jac → src/app.jac} +28 -28
  34. jac_client/examples/basic-full-stack/{app.jac → src/app.jac} +166 -127
  35. jac_client/examples/css-styling/js-styling/{app.jac → src/app.jac} +7 -7
  36. jac_client/examples/css-styling/material-ui/{app.jac → src/app.jac} +6 -6
  37. jac_client/examples/css-styling/pure-css/{app.jac → src/app.jac} +7 -7
  38. jac_client/examples/css-styling/sass-example/{app.jac → src/app.jac} +7 -7
  39. jac_client/examples/css-styling/styled-components/{app.jac → src/app.jac} +6 -6
  40. jac_client/examples/css-styling/tailwind-example/{app.jac → src/app.jac} +7 -7
  41. jac_client/examples/full-stack-with-auth/{app.jac → src/app.jac} +47 -47
  42. jac_client/examples/little-x/{app.jac → src/app.jac} +27 -32
  43. jac_client/examples/little-x/src/submit-button.jac +16 -0
  44. jac_client/examples/nested-folders/nested-advance/{ButtonRoot.jac → src/ButtonRoot.jac} +1 -1
  45. jac_client/examples/nested-folders/nested-advance/{app.jac → src/app.jac} +1 -1
  46. jac_client/examples/nested-folders/nested-advance/{level1 → src/level1}/ButtonSecondL.jac +1 -1
  47. jac_client/examples/nested-folders/nested-advance/{level1 → src/level1}/Card.jac +1 -1
  48. jac_client/examples/nested-folders/nested-advance/{level1 → src/level1}/level2/ButtonThirdL.jac +1 -1
  49. jac_client/examples/nested-folders/nested-basic/{app.jac → src/app.jac} +2 -2
  50. jac_client/examples/nested-folders/nested-basic/{button.jac → src/button.jac} +1 -1
  51. jac_client/examples/nested-folders/nested-basic/{components → src/components}/button.jac +1 -1
  52. jac_client/examples/ts-support/src/app.jac +35 -0
  53. jac_client/examples/with-router/{app.jac → src/app.jac} +15 -15
  54. jac_client/plugin/cli.jac +504 -0
  55. jac_client/plugin/client.jac +45 -0
  56. jac_client/plugin/client_runtime.cl.jac +42 -0
  57. jac_client/plugin/impl/client.impl.jac +193 -0
  58. jac_client/plugin/impl/client_runtime.impl.jac +195 -0
  59. jac_client/plugin/impl/vite_client_bundle.impl.jac +72 -0
  60. jac_client/plugin/plugin_config.jac +195 -0
  61. jac_client/plugin/src/__init__.jac +20 -0
  62. jac_client/plugin/src/asset_processor.jac +33 -0
  63. jac_client/plugin/src/babel_processor.jac +18 -0
  64. jac_client/plugin/src/compiler.jac +67 -0
  65. jac_client/plugin/src/config_loader.jac +32 -0
  66. jac_client/plugin/src/impl/asset_processor.impl.jac +127 -0
  67. jac_client/plugin/src/impl/babel_processor.impl.jac +89 -0
  68. jac_client/plugin/src/impl/compiler.impl.jac +288 -0
  69. jac_client/plugin/src/impl/config_loader.impl.jac +119 -0
  70. jac_client/plugin/src/impl/import_processor.impl.jac +33 -0
  71. jac_client/plugin/src/impl/jac_to_js.impl.jac +41 -0
  72. jac_client/plugin/src/impl/package_installer.impl.jac +105 -0
  73. jac_client/plugin/src/impl/vite_bundler.impl.jac +626 -0
  74. jac_client/plugin/src/import_processor.jac +19 -0
  75. jac_client/plugin/src/jac_to_js.jac +35 -0
  76. jac_client/plugin/src/package_installer.jac +26 -0
  77. jac_client/plugin/src/vite_bundler.jac +44 -0
  78. jac_client/plugin/vite_client_bundle.jac +31 -0
  79. jac_client/tests/conftest.py +283 -0
  80. jac_client/tests/fixtures/basic-app/app.jac +2 -2
  81. jac_client/tests/fixtures/cl_file/app.cl.jac +2 -2
  82. jac_client/tests/fixtures/client_app_with_antd/app.jac +1 -1
  83. jac_client/tests/fixtures/js_import/app.jac +5 -5
  84. jac_client/tests/fixtures/spawn_test/app.jac +15 -18
  85. jac_client/tests/fixtures/with-ts/app.jac +35 -0
  86. jac_client/tests/test_cli.py +811 -0
  87. jac_client/tests/test_it.py +592 -97
  88. {jac_client-0.2.3.dist-info → jac_client-0.2.8.dist-info}/METADATA +41 -34
  89. jac_client-0.2.8.dist-info/RECORD +97 -0
  90. {jac_client-0.2.3.dist-info → jac_client-0.2.8.dist-info}/WHEEL +2 -1
  91. jac_client-0.2.8.dist-info/entry_points.txt +4 -0
  92. jac_client-0.2.8.dist-info/top_level.txt +1 -0
  93. jac_client/docs/README.md +0 -689
  94. jac_client/docs/advanced-state.md +0 -1265
  95. jac_client/docs/asset-serving/intro.md +0 -209
  96. jac_client/docs/assets/pipe_line-v2.svg +0 -32
  97. jac_client/docs/assets/pipe_line.png +0 -0
  98. jac_client/docs/file-system/app.jac.md +0 -121
  99. jac_client/docs/file-system/backend-frontend.md +0 -217
  100. jac_client/docs/file-system/intro.md +0 -72
  101. jac_client/docs/file-system/nested-imports.md +0 -348
  102. jac_client/docs/guide-example/intro.md +0 -115
  103. jac_client/docs/guide-example/step-01-setup.md +0 -270
  104. jac_client/docs/guide-example/step-02-components.md +0 -416
  105. jac_client/docs/guide-example/step-03-styling.md +0 -478
  106. jac_client/docs/guide-example/step-04-todo-ui.md +0 -477
  107. jac_client/docs/guide-example/step-05-local-state.md +0 -530
  108. jac_client/docs/guide-example/step-06-events.md +0 -749
  109. jac_client/docs/guide-example/step-07-effects.md +0 -468
  110. jac_client/docs/guide-example/step-08-walkers.md +0 -534
  111. jac_client/docs/guide-example/step-09-authentication.md +0 -586
  112. jac_client/docs/guide-example/step-10-routing.md +0 -539
  113. jac_client/docs/guide-example/step-11-final.md +0 -963
  114. jac_client/docs/imports.md +0 -1141
  115. jac_client/docs/lifecycle-hooks.md +0 -773
  116. jac_client/docs/routing.md +0 -659
  117. jac_client/docs/styling/intro.md +0 -249
  118. jac_client/docs/styling/js-styling.md +0 -367
  119. jac_client/docs/styling/material-ui.md +0 -341
  120. jac_client/docs/styling/pure-css.md +0 -299
  121. jac_client/docs/styling/sass.md +0 -403
  122. jac_client/docs/styling/styled-components.md +0 -395
  123. jac_client/docs/styling/tailwind.md +0 -298
  124. jac_client/examples/all-in-one/.babelrc +0 -9
  125. jac_client/examples/all-in-one/README.md +0 -16
  126. jac_client/examples/all-in-one/assets/burger.png +0 -0
  127. jac_client/examples/all-in-one/package.json +0 -29
  128. jac_client/examples/all-in-one/styles.css +0 -26
  129. jac_client/examples/all-in-one/vite.config.js +0 -28
  130. jac_client/examples/asset-serving/css-with-image/.babelrc +0 -9
  131. jac_client/examples/asset-serving/css-with-image/README.md +0 -91
  132. jac_client/examples/asset-serving/css-with-image/assets/burger.png +0 -0
  133. jac_client/examples/asset-serving/css-with-image/package.json +0 -28
  134. jac_client/examples/asset-serving/css-with-image/styles.css +0 -26
  135. jac_client/examples/asset-serving/css-with-image/vite.config.js +0 -28
  136. jac_client/examples/asset-serving/image-asset/.babelrc +0 -9
  137. jac_client/examples/asset-serving/image-asset/README.md +0 -119
  138. jac_client/examples/asset-serving/image-asset/assets/burger.png +0 -0
  139. jac_client/examples/asset-serving/image-asset/package.json +0 -28
  140. jac_client/examples/asset-serving/image-asset/styles.css +0 -26
  141. jac_client/examples/asset-serving/image-asset/vite.config.js +0 -28
  142. jac_client/examples/asset-serving/import-alias/.babelrc +0 -9
  143. jac_client/examples/asset-serving/import-alias/README.md +0 -83
  144. jac_client/examples/asset-serving/import-alias/assets/burger.png +0 -0
  145. jac_client/examples/asset-serving/import-alias/package.json +0 -28
  146. jac_client/examples/asset-serving/import-alias/vite.config.js +0 -28
  147. jac_client/examples/basic/.babelrc +0 -9
  148. jac_client/examples/basic/README.md +0 -16
  149. jac_client/examples/basic/package.json +0 -27
  150. jac_client/examples/basic/vite.config.js +0 -27
  151. jac_client/examples/basic-auth/.babelrc +0 -9
  152. jac_client/examples/basic-auth/README.md +0 -16
  153. jac_client/examples/basic-auth/app.jac +0 -308
  154. jac_client/examples/basic-auth/package.json +0 -27
  155. jac_client/examples/basic-auth/vite.config.js +0 -27
  156. jac_client/examples/basic-auth-with-router/.babelrc +0 -9
  157. jac_client/examples/basic-auth-with-router/README.md +0 -60
  158. jac_client/examples/basic-auth-with-router/package.json +0 -28
  159. jac_client/examples/basic-auth-with-router/vite.config.js +0 -27
  160. jac_client/examples/basic-full-stack/.babelrc +0 -9
  161. jac_client/examples/basic-full-stack/README.md +0 -18
  162. jac_client/examples/basic-full-stack/package.json +0 -28
  163. jac_client/examples/basic-full-stack/vite.config.js +0 -27
  164. jac_client/examples/css-styling/js-styling/.babelrc +0 -9
  165. jac_client/examples/css-styling/js-styling/README.md +0 -183
  166. jac_client/examples/css-styling/js-styling/package.json +0 -28
  167. jac_client/examples/css-styling/js-styling/styles.js +0 -100
  168. jac_client/examples/css-styling/js-styling/vite.config.js +0 -27
  169. jac_client/examples/css-styling/material-ui/.babelrc +0 -9
  170. jac_client/examples/css-styling/material-ui/README.md +0 -16
  171. jac_client/examples/css-styling/material-ui/package.json +0 -32
  172. jac_client/examples/css-styling/material-ui/vite.config.js +0 -27
  173. jac_client/examples/css-styling/pure-css/.babelrc +0 -9
  174. jac_client/examples/css-styling/pure-css/README.md +0 -16
  175. jac_client/examples/css-styling/pure-css/package.json +0 -28
  176. jac_client/examples/css-styling/pure-css/styles.css +0 -111
  177. jac_client/examples/css-styling/pure-css/vite.config.js +0 -27
  178. jac_client/examples/css-styling/sass-example/.babelrc +0 -9
  179. jac_client/examples/css-styling/sass-example/README.md +0 -16
  180. jac_client/examples/css-styling/sass-example/package.json +0 -29
  181. jac_client/examples/css-styling/sass-example/styles.scss +0 -153
  182. jac_client/examples/css-styling/sass-example/vite.config.js +0 -27
  183. jac_client/examples/css-styling/styled-components/.babelrc +0 -9
  184. jac_client/examples/css-styling/styled-components/README.md +0 -16
  185. jac_client/examples/css-styling/styled-components/package.json +0 -29
  186. jac_client/examples/css-styling/styled-components/styled.js +0 -90
  187. jac_client/examples/css-styling/styled-components/vite.config.js +0 -27
  188. jac_client/examples/css-styling/tailwind-example/.babelrc +0 -9
  189. jac_client/examples/css-styling/tailwind-example/README.md +0 -16
  190. jac_client/examples/css-styling/tailwind-example/global.css +0 -1
  191. jac_client/examples/css-styling/tailwind-example/package.json +0 -30
  192. jac_client/examples/css-styling/tailwind-example/vite.config.js +0 -29
  193. jac_client/examples/full-stack-with-auth/.babelrc +0 -9
  194. jac_client/examples/full-stack-with-auth/README.md +0 -16
  195. jac_client/examples/full-stack-with-auth/package.json +0 -28
  196. jac_client/examples/full-stack-with-auth/vite.config.js +0 -29
  197. jac_client/examples/little-x/package.json +0 -23
  198. jac_client/examples/little-x/submit-button.jac +0 -8
  199. jac_client/examples/nested-folders/nested-advance/.babelrc +0 -9
  200. jac_client/examples/nested-folders/nested-advance/README.md +0 -77
  201. jac_client/examples/nested-folders/nested-advance/package.json +0 -29
  202. jac_client/examples/nested-folders/nested-advance/vite.config.js +0 -28
  203. jac_client/examples/nested-folders/nested-basic/.babelrc +0 -9
  204. jac_client/examples/nested-folders/nested-basic/README.md +0 -183
  205. jac_client/examples/nested-folders/nested-basic/app.js +0 -7
  206. jac_client/examples/nested-folders/nested-basic/package.json +0 -28
  207. jac_client/examples/nested-folders/nested-basic/vite.config.js +0 -27
  208. jac_client/examples/with-router/.babelrc +0 -9
  209. jac_client/examples/with-router/README.md +0 -17
  210. jac_client/examples/with-router/package.json +0 -28
  211. jac_client/examples/with-router/vite.config.js +0 -27
  212. jac_client/plugin/cli.py +0 -244
  213. jac_client/plugin/client.py +0 -152
  214. jac_client/plugin/client_runtime.jac +0 -234
  215. jac_client/plugin/vite_client_bundle.py +0 -503
  216. jac_client/tests/fixtures/js_import/utils.js +0 -21
  217. jac_client/tests/fixtures/package-lock.json +0 -329
  218. jac_client/tests/fixtures/package.json +0 -11
  219. jac_client/tests/test_asset_examples.py +0 -322
  220. jac_client/tests/test_cl.py +0 -530
  221. jac_client/tests/test_create_jac_app.py +0 -131
  222. jac_client/tests/test_nested_file.py +0 -374
  223. jac_client-0.2.3.dist-info/RECORD +0 -171
  224. jac_client-0.2.3.dist-info/entry_points.txt +0 -4
@@ -1,403 +0,0 @@
1
- # Sass/SCSS
2
-
3
- CSS preprocessor with variables, nesting, mixins, and functions for Jac applications.
4
-
5
- ## Overview
6
-
7
- Sass (Syntactically Awesome Style Sheets) extends CSS with powerful features like variables, nesting, mixins, and functions. This approach is perfect for:
8
- - Large projects with shared styles
9
- - DRY (Don't Repeat Yourself) principles
10
- - Complex styling logic
11
- - Maintainable CSS architecture
12
-
13
- ## Example
14
-
15
- See the complete working example: [`examples/css-styling/sass-example/`](../../examples/css-styling/sass-example/)
16
-
17
- ## Quick Start
18
-
19
- ### 1. Install Sass
20
-
21
- Add to `package.json`:
22
-
23
- ```json
24
- {
25
- "devDependencies": {
26
- "sass": "^1.77.8"
27
- }
28
- }
29
- ```
30
-
31
- ### 2. Create SCSS File
32
-
33
- Create `styles.scss`:
34
-
35
- ```scss
36
- $primary-color: #007bff;
37
- $secondary-color: #6c757d;
38
-
39
- .button {
40
- background-color: $primary-color;
41
- color: white;
42
- padding: 0.75rem 1.5rem;
43
- border-radius: 0.5rem;
44
-
45
- &:hover {
46
- background-color: darken($primary-color, 10%);
47
- }
48
- }
49
- ```
50
-
51
- ### 3. Import in Jac
52
-
53
- ```jac
54
- # Pages
55
- cl import from react {useState, useEffect}
56
- cl import ".styles.scss";
57
-
58
- cl {
59
- def app() -> any {
60
- return <div className="container">
61
- <button className="button">Click Me</button>
62
- </div>;
63
- }
64
- }
65
- ```
66
-
67
- Vite automatically compiles SCSS to CSS during the build process.
68
-
69
- ## Sass Features
70
-
71
- ### Variables
72
-
73
- Define reusable values:
74
-
75
- ```scss
76
- $primary-gradient-start: #dbeafe;
77
- $primary-gradient-end: #e0e7ff;
78
- $white: #ffffff;
79
- $gray-800: #1f2937;
80
- $spacing-unit: 1rem;
81
- ```
82
-
83
- ### Nesting
84
-
85
- Nest selectors for better organization:
86
-
87
- ```scss
88
- .button {
89
- padding: 0.75rem 1.5rem;
90
- border-radius: 0.5rem;
91
-
92
- &:hover {
93
- transform: scale(1.05);
94
- }
95
-
96
- &:active {
97
- transform: scale(0.95);
98
- }
99
-
100
- &Decrement {
101
- background-color: $red-500;
102
- }
103
-
104
- &Reset {
105
- background-color: $gray-500;
106
- }
107
- }
108
- ```
109
-
110
- ### Mixins
111
-
112
- Create reusable style blocks:
113
-
114
- ```scss
115
- @mixin flex-center {
116
- display: flex;
117
- align-items: center;
118
- justify-content: center;
119
- }
120
-
121
- @mixin button-base {
122
- color: $white;
123
- font-weight: bold;
124
- padding: 0.75rem 1.5rem;
125
- border-radius: 0.5rem;
126
- border: none;
127
- cursor: pointer;
128
-
129
- &:hover {
130
- transform: scale(1.05);
131
- }
132
- }
133
-
134
- .container {
135
- @include flex-center;
136
- min-height: 100vh;
137
- }
138
-
139
- .button {
140
- @include button-base;
141
- background-color: $primary-color;
142
- }
143
- ```
144
-
145
- ### Functions
146
-
147
- Use built-in and custom functions:
148
-
149
- ```scss
150
- .button {
151
- background-color: $red-500;
152
-
153
- &:hover {
154
- background-color: darken($red-500, 10%);
155
- }
156
- }
157
-
158
- .card {
159
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
160
-
161
- &:hover {
162
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
163
- }
164
- }
165
- ```
166
-
167
- ### Partials and Imports
168
-
169
- Organize styles across multiple files:
170
-
171
- ```scss
172
- // _variables.scss
173
- $primary: #007bff;
174
- $secondary: #6c757d;
175
-
176
- // _mixins.scss
177
- @mixin flex-center {
178
- display: flex;
179
- align-items: center;
180
- justify-content: center;
181
- }
182
-
183
- // styles.scss
184
- @import 'variables';
185
- @import 'mixins';
186
-
187
- .container {
188
- @include flex-center;
189
- background-color: $primary;
190
- }
191
- ```
192
-
193
- ## Best Practices
194
-
195
- ### 1. Use Variables
196
-
197
- Define colors, spacing, and other values as variables:
198
-
199
- ```scss
200
- $colors: (
201
- primary: #007bff,
202
- secondary: #6c757d,
203
- success: #28a745,
204
- danger: #dc3545,
205
- );
206
-
207
- .button {
208
- background-color: map-get($colors, primary);
209
- }
210
- ```
211
-
212
- ### 2. Create Mixins
213
-
214
- Extract common patterns into mixins:
215
-
216
- ```scss
217
- @mixin respond-to($breakpoint) {
218
- @media (min-width: $breakpoint) {
219
- @content;
220
- }
221
- }
222
-
223
- .container {
224
- padding: 1rem;
225
-
226
- @include respond-to(768px) {
227
- padding: 2rem;
228
- }
229
- }
230
- ```
231
-
232
- ### 3. Organize with Partials
233
-
234
- Split large files into smaller modules:
235
-
236
- ```
237
- styles/
238
- ├── _variables.scss
239
- ├── _mixins.scss
240
- ├── _components.scss
241
- └── main.scss
242
- ```
243
-
244
- ### 4. Use Nesting Wisely
245
-
246
- Don't nest too deeply (max 3-4 levels):
247
-
248
- ```scss
249
- // Good
250
- .card {
251
- padding: 1rem;
252
-
253
- &__header {
254
- font-weight: bold;
255
- }
256
- }
257
-
258
- // Avoid
259
- .card {
260
- .header {
261
- .title {
262
- .text {
263
- // Too deep!
264
- }
265
- }
266
- }
267
- }
268
- ```
269
-
270
- ### 5. Leverage Functions
271
-
272
- Use Sass functions for calculations:
273
-
274
- ```scss
275
- .container {
276
- width: percentage(2/3);
277
- margin: rem(16px);
278
- }
279
- ```
280
-
281
- ## Common Patterns
282
-
283
- ### BEM with Nesting
284
-
285
- ```scss
286
- .card {
287
- padding: 1rem;
288
-
289
- &__header {
290
- padding: 1rem;
291
- border-bottom: 1px solid #ddd;
292
- }
293
-
294
- &__body {
295
- padding: 1.5rem;
296
- }
297
-
298
- &--highlighted {
299
- border: 2px solid $primary;
300
- }
301
- }
302
- ```
303
-
304
- ### Color Management
305
-
306
- ```scss
307
- $colors: (
308
- primary: #007bff,
309
- secondary: #6c757d,
310
- success: #28a745,
311
- danger: #dc3545,
312
- );
313
-
314
- @function color($name) {
315
- @return map-get($colors, $name);
316
- }
317
-
318
- .button {
319
- background-color: color(primary);
320
- }
321
- ```
322
-
323
- ### Responsive Mixins
324
-
325
- ```scss
326
- @mixin respond-to($breakpoint) {
327
- @if $breakpoint == mobile {
328
- @media (max-width: 767px) { @content; }
329
- }
330
- @else if $breakpoint == tablet {
331
- @media (min-width: 768px) { @content; }
332
- }
333
- @else if $breakpoint == desktop {
334
- @media (min-width: 1024px) { @content; }
335
- }
336
- }
337
-
338
- .container {
339
- padding: 1rem;
340
-
341
- @include respond-to(tablet) {
342
- padding: 2rem;
343
- }
344
- }
345
- ```
346
-
347
- ## Advantages
348
-
349
- - **Variables** for maintainable theming
350
- - **Nesting** for better organization
351
- - **Mixins** for reusable code
352
- - **Functions** for dynamic values
353
- - **Partials** for modular CSS
354
- - **Compiles to standard CSS**
355
- - **Large ecosystem** and community
356
-
357
- ## Limitations
358
-
359
- - **Requires build step**
360
- - **Learning curve** for Sass syntax
361
- - **Can get complex** with deep nesting
362
- - **Additional dependency**
363
- - **Debugging** can be harder (source maps help)
364
-
365
- ## When to Use
366
-
367
- Choose Sass/SCSS when:
368
-
369
- - You're working on large projects
370
- - You need variables and mixins
371
- - You want better CSS organization
372
- - You prefer preprocessing over runtime CSS
373
- - You need complex styling logic
374
- - You want to share styles across components
375
-
376
- ## Import Syntax
377
-
378
- SCSS files are imported using the `cl import` syntax:
379
-
380
- ```jac
381
- cl import ".styles.scss";
382
- ```
383
-
384
- This compiles to:
385
-
386
- ```javascript
387
- import "./styles.scss";
388
- ```
389
-
390
- Vite automatically processes SCSS imports and compiles them to CSS.
391
-
392
- ## Next Steps
393
-
394
- - Explore [Sass Documentation](https://sass-lang.com/documentation)
395
- - Check out [Less](./less.md) for similar preprocessing (coming soon)
396
- - Learn about [PostCSS](./postcss.md) for CSS transformations (coming soon)
397
- - See [Pure CSS](./pure-css.md) for traditional CSS approach
398
-
399
- ## Resources
400
-
401
- - [Sass Documentation](https://sass-lang.com/documentation)
402
- - [Sass Guidelines](https://sass-guidelin.es/)
403
- - [Sass Playground](https://www.sassmeister.com/)