You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,9 @@
1
1
# Svelte preprocess CSS Modules, changelog
2
2
3
-
## 1.2.0 (Sept 21, 2020)
3
+
## 1.2.1 (Oct 31, 2020)
4
+
- Fix class chaining and pseudo selector [pull request #8](https://github.com/micantoine/svelte-preprocess-cssmodules/pull/8)
5
+
6
+
## 1.2.0 (Sept 21, 2020)
4
7
- Add support for `getLocalIdent()`[issue #6](https://github.com/micantoine/svelte-preprocess-cssmodules/issues/6) - [pull request #7](https://github.com/micantoine/svelte-preprocess-cssmodules/pull/7)
Copy file name to clipboardExpand all lines: README.md
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -66,11 +66,11 @@ Pass an object of the following properties
66
66
|`localIdentName`|`{String}`|`"[local]-[hash:base64:6]"`| A rule using any available token from [webpack interpolateName](https://github.com/webpack/loader-utils#interpolatename)|
67
67
|`includePaths`|`{Array}`|`[]` (Any) | An array of paths to be processed |
68
68
|`getLocalIdent`|`Function`|`undefined`| Generate the classname by specifying a function instead of using the built-in interpolation |
69
-
| `strict` | `Boolean` | `false` | When true, an exception is raised when a class is used while not being defined in `<style>`
69
+
| `strict` | `{Boolean}` | `false` | When true, an exception is raised when a class is used while not being defined in `<style>`
70
70
71
71
#### `getLocalIdent`
72
72
73
-
Function to generate the classname instead of the built-in function.
73
+
Function to generate the classname instead of relying on the built-in function.
74
74
75
75
```js
76
76
functiongetLocalIdent(
@@ -150,7 +150,7 @@ The component will be transformed to
150
150
151
151
### Replace only the required class
152
152
153
-
CSS Modules classname are generated to the html class values prefixed by `$style.`. The rest is left untouched.
153
+
CSS Modules classname are generated to the html class values prefixed by `$style.`. The rest is left untouched and will use the default svelte scoped class.
154
154
155
155
*Before*
156
156
@@ -169,18 +169,18 @@ CSS Modules classname are generated to the html class values prefixed by `$style
<pclass="text-center svelte-1s2ez3w">My blue text</p>
203
203
```
204
204
205
205
### Target any classname format
@@ -405,25 +405,25 @@ export default {
405
405
background-color: #fff;
406
406
transform: translateX(-50%) translateY(-50%);
407
407
}
408
-
section {
408
+
section.svelte-1s2ez3w {
409
409
flex: 01auto;
410
410
flex-direction: column;
411
411
display: flex;
412
412
height: 100%;
413
413
}
414
-
header {
414
+
header.svelte-1s2ez3w {
415
415
padding: 1rem;
416
416
border-bottom: 1pxsolid#d9d9d9;
417
417
}
418
418
._1HPUBXtzNG {
419
419
padding: 1rem;
420
420
flex: 100;
421
421
}
422
-
footer {
422
+
footer.svelte-1s2ez3w {
423
423
padding: 1rem;
424
424
border-top: 1pxsolid#d9d9d9;
425
425
}
426
-
button {
426
+
button.svelte-1s2ez3w {
427
427
background: #fff;
428
428
border: 1pxsolid#ccc;
429
429
border-radius: 5px;
@@ -447,11 +447,11 @@ export default {
447
447
</div>
448
448
```
449
449
450
-
**Note:** The svelte scoped classes are still being applied to the html elements with a style.
450
+
**Note:** The svelte scoped class is still being applied to the html elements with a style.
451
451
452
452
## Why CSS Modules on Svelte
453
453
454
-
While the native CSS Scoped system should be largely enough to avoid class conflict, it could find its limit when working on a hybrid project. On a non full Svelte application where it is used to enhance pieces of the page; the thought on the class naming is no less different than the one on a regular html page to avoid conflict and unwilling inheritance. For example, on the modal component above, It would have been wiser to namespace some of the classes such as `.modal-body` and `.modal-cancel` to avoid inheriting styles from other `.body` and `.cancel`.
454
+
While the native CSS Scoped system should be largely enough to avoid class conflict, it could find its limit when working on a hybrid project. On a non full Svelte application, the thought on the class naming would not be less different than what we would do on a regular html page. For example, on the modal component above, It would have been wiser to namespace some of the classes such as `.modal-body` and `.modal-cancel`in order to prevent inheriting styles from other `.body` and `.cancel` classes.
0 commit comments