@lynx-js/template-webpack-plugin-canary 0.8.0 → 0.8.1-canary-20250626-69fb0420
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/CHANGELOG.md +24 -4
- package/lib/web/genStyleInfo.js +13 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @lynx-js/template-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.8.1-canary-20250626045754-69fb0420e297abf768c889769c95a207c480b3c7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: `::placeholder` will be compiled to `part(input)::placeholder`, which means you can use pseudo-element CSS to add placeholder styles to input and textarea. ([#1158](https://github.com/lynx-family/lynx-stack/pull/1158))
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
// before
|
|
11
|
+
<input placeholder-color='red' placeholder-font-weight='bold' placeholder-font-size='20px'>
|
|
12
|
+
|
|
13
|
+
// after
|
|
14
|
+
<input>
|
|
15
|
+
|
|
16
|
+
input::placeholder {
|
|
17
|
+
color: red;
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
font-size: 20px;
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
3
23
|
## 0.8.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -44,7 +64,7 @@
|
|
|
44
64
|
example:
|
|
45
65
|
|
|
46
66
|
```js
|
|
47
|
-
import { defineConfig } from
|
|
67
|
+
import { defineConfig } from "@lynx-js/rspeedy";
|
|
48
68
|
|
|
49
69
|
export default defineConfig({
|
|
50
70
|
output: {
|
|
@@ -139,7 +159,7 @@
|
|
|
139
159
|
- Add `defaultOverflowVisible` option to `LynxTemplatePlugin`. ([#78](https://github.com/lynx-family/lynx-stack/pull/78))
|
|
140
160
|
|
|
141
161
|
```js
|
|
142
|
-
import { LynxTemplatePlugin } from
|
|
162
|
+
import { LynxTemplatePlugin } from "@lynx-js/template-webpack-plugin";
|
|
143
163
|
|
|
144
164
|
new LynxTemplatePlugin({
|
|
145
165
|
defaultOverflowVisible: false,
|
|
@@ -158,10 +178,10 @@
|
|
|
158
178
|
- 1abf8f0: Add `entryNames` parameter to `beforeEncode` hook.
|
|
159
179
|
|
|
160
180
|
```js
|
|
161
|
-
import { LynxTemplatePlugin } from
|
|
181
|
+
import { LynxTemplatePlugin } from "@lynx-js/template-webpack-plugin";
|
|
162
182
|
|
|
163
183
|
const hooks = LynxTemplatePlugin.getLynxTemplatePluginHooks(compilation);
|
|
164
|
-
hooks.beforeEncode.tap(
|
|
184
|
+
hooks.beforeEncode.tap("MyPlugin", ({ entryNames }) => {
|
|
165
185
|
console.log(entryNames);
|
|
166
186
|
});
|
|
167
187
|
```
|
package/lib/web/genStyleInfo.js
CHANGED
|
@@ -55,7 +55,19 @@ export function genStyleInfo(cssMap) {
|
|
|
55
55
|
pseudoClassSelectors.push(CSS.csstree.generate(selector));
|
|
56
56
|
}
|
|
57
57
|
else if (selector.type === 'PseudoElementSelector') {
|
|
58
|
-
|
|
58
|
+
/**
|
|
59
|
+
* [aa]::placeholder {
|
|
60
|
+
* }
|
|
61
|
+
* ===>
|
|
62
|
+
* [aa]::part(input)::placeholder {
|
|
63
|
+
* }
|
|
64
|
+
*/
|
|
65
|
+
if (selector.name === 'placeholder') {
|
|
66
|
+
pseudoClassSelectors.push('::part(input)::placeholder');
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
pseudoElementSelectors.push(CSS.csstree.generate(selector));
|
|
70
|
+
}
|
|
59
71
|
}
|
|
60
72
|
else if (selector.type === 'TypeSelector') {
|
|
61
73
|
plainSelectors.push(`[lynx-tag="${selector.name}"]`);
|
package/package.json
CHANGED