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
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
# Svelte preprocess CSS Modules, changelog
2
2
3
+
## 1.2.0 (Sept 21, 2020)
4
+
- 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)
5
+
3
6
## 1.1.1
4
7
- Fix the use of `[path]` in the `localIdentName` rule.
|`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
+
|`getLocalIdent`|`Function`|`undefined`| Generate the classname by specifying a function instead of using the built-in interpolation |
68
69
70
+
#### `getLocalIdent`
71
+
72
+
Function to generate the classname instead of the built-in function.
73
+
74
+
```js
75
+
functiongetLocalIdent(
76
+
context: {
77
+
context, // the context path
78
+
resourcePath, // path + filename
79
+
},
80
+
localIdentName: {
81
+
template, // the template rule
82
+
interpolatedName, // the built-in generated classname
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 javascript front-end where Svelte 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. 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`.
453
+
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`.
0 commit comments