File tree Expand file tree Collapse file tree 12 files changed +123
-0
lines changed Expand file tree Collapse file tree 12 files changed +123
-0
lines changed Original file line number Diff line number Diff line change 5
5
### Added
6
6
7
7
- A way to customize resolving remote stylesheets.
8
+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8
9
9
10
### Changed
10
11
Original file line number Diff line number Diff line change @@ -126,6 +126,21 @@ The `data-css-inline="ignore"` attribute also allows you to skip `link` and `sty
126
126
</body >
127
127
```
128
128
129
+ Alternatively, you may keep ` style ` from being removed by using the ` data-css-inline="keep" ` attribute.
130
+ This is useful if you want to keep ` @media ` queries for responsive emails in separate ` style ` tags:
131
+
132
+ ``` html
133
+ <head >
134
+ <!-- Styles below are not removed -->
135
+ <style data-css-inline =" keep" >h1 { color :blue ; } </style >
136
+ </head >
137
+ <body >
138
+ <h1 >Big Text</h1 >
139
+ </body >
140
+ ```
141
+
142
+ Such tags will be kept in the resulting HTML even if the ` keep_style_tags ` option is set to ` false ` .
143
+
129
144
If you'd like to load stylesheets from your filesystem, use the ` file:// ` scheme:
130
145
131
146
``` rust
Original file line number Diff line number Diff line change 2
2
3
3
## [ Unreleased]
4
4
5
+ ### Added
6
+
7
+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8
+
5
9
### Fixed
6
10
7
11
- Lookups for previous / next siblings, affecting selectors like ` nth-child ` . [ #324 ] ( https://github.com/Stranger6667/css-inline/issues/324 )
Original file line number Diff line number Diff line change @@ -141,6 +141,21 @@ The `data-css-inline="ignore"` attribute also allows you to skip `link` and `sty
141
141
</body >
142
142
```
143
143
144
+ Alternatively, you may keep ` style ` from being removed by using the ` data-css-inline="keep" ` attribute.
145
+ This is useful if you want to keep ` @media ` queries for responsive emails in separate ` style ` tags:
146
+
147
+ ``` html
148
+ <head >
149
+ <!-- Styles below are not removed -->
150
+ <style data-css-inline =" keep" >h1 { color :blue ; } </style >
151
+ </head >
152
+ <body >
153
+ <h1 >Big Text</h1 >
154
+ </body >
155
+ ```
156
+
157
+ Such tags will be kept in the resulting HTML even if the ` keep_style_tags ` option is set to ` false ` .
158
+
144
159
## License
145
160
146
161
This project is licensed under the terms of the [ MIT license] ( https://opensource.org/licenses/MIT ) .
Original file line number Diff line number Diff line change 2
2
3
3
## [ Unreleased]
4
4
5
+ ### Added
6
+
7
+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8
+
5
9
### Fixed
6
10
7
11
- Lookups for previous / next siblings, affecting selectors like ` nth-child ` . [ #324 ] ( https://github.com/Stranger6667/css-inline/issues/324 )
Original file line number Diff line number Diff line change @@ -110,6 +110,21 @@ The `data-css-inline="ignore"` attribute also allows you to skip `link` and `sty
110
110
</body >
111
111
```
112
112
113
+ Alternatively, you may keep ` style ` from being removed by using the ` data-css-inline="keep" ` attribute.
114
+ This is useful if you want to keep ` @media ` queries for responsive emails in separate ` style ` tags:
115
+
116
+ ``` html
117
+ <head >
118
+ <!-- Styles below are not removed -->
119
+ <style data-css-inline =" keep" >h1 { color :blue ; } </style >
120
+ </head >
121
+ <body >
122
+ <h1 >Big Text</h1 >
123
+ </body >
124
+ ```
125
+
126
+ Such tags will be kept in the resulting HTML even if the ` keep_style_tags ` option is set to ` false ` .
127
+
113
128
## WebAssembly
114
129
115
130
` css-inline ` also ships a WebAssembly module built with ` wasm-bindgen ` to run in browsers.
Original file line number Diff line number Diff line change 2
2
3
3
## [ Unreleased]
4
4
5
+ ### Added
6
+
7
+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8
+
5
9
### Fixed
6
10
7
11
- Lookups for previous / next siblings, affecting selectors like ` nth-child ` . [ #324 ] ( https://github.com/Stranger6667/css-inline/issues/324 )
Original file line number Diff line number Diff line change @@ -144,6 +144,21 @@ The `data-css-inline="ignore"` attribute also allows you to skip `link` and `sty
144
144
</body >
145
145
```
146
146
147
+ Alternatively, you may keep ` style ` from being removed by using the ` data-css-inline="keep" ` attribute.
148
+ This is useful if you want to keep ` @media ` queries for responsive emails in separate ` style ` tags:
149
+
150
+ ``` html
151
+ <head >
152
+ <!-- Styles below are not removed -->
153
+ <style data-css-inline =" keep" >h1 { color :blue ; } </style >
154
+ </head >
155
+ <body >
156
+ <h1 >Big Text</h1 >
157
+ </body >
158
+ ```
159
+
160
+ Such tags will be kept in the resulting HTML even if the ` keep_style_tags ` option is set to ` false ` .
161
+
147
162
If you'd like to load stylesheets from your filesystem, use the ` file:// ` scheme:
148
163
149
164
``` python
Original file line number Diff line number Diff line change 2
2
3
3
## [ Unreleased]
4
4
5
+ ### Added
6
+
7
+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8
+
5
9
### Fixed
6
10
7
11
- Lookups for previous / next siblings, affecting selectors like ` nth-child ` . [ #324 ] ( https://github.com/Stranger6667/css-inline/issues/324 )
Original file line number Diff line number Diff line change @@ -125,6 +125,21 @@ The `data-css-inline="ignore"` attribute also allows you to skip `link` and `sty
125
125
</body >
126
126
```
127
127
128
+ Alternatively, you may keep ` style ` from being removed by using the ` data-css-inline="keep" ` attribute.
129
+ This is useful if you want to keep ` @media ` queries for responsive emails in separate ` style ` tags:
130
+
131
+ ``` html
132
+ <head >
133
+ <!-- Styles below are not removed -->
134
+ <style data-css-inline =" keep" >h1 { color :blue ; } </style >
135
+ </head >
136
+ <body >
137
+ <h1 >Big Text</h1 >
138
+ </body >
139
+ ```
140
+
141
+ Such tags will be kept in the resulting HTML even if the ` keep_style_tags ` option is set to ` false ` .
142
+
128
143
If you'd like to load stylesheets from your filesystem, use the ` file:// ` scheme:
129
144
130
145
``` ruby
You can’t perform that action at this time.
0 commit comments