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 55### Added
66
77- A way to customize resolving remote stylesheets.
8+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
89
910### Changed
1011
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
126126</body >
127127```
128128
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+
129144If you'd like to load stylesheets from your filesystem, use the ` file:// ` scheme:
130145
131146``` rust
Original file line number Diff line number Diff line change 22
33## [ Unreleased]
44
5+ ### Added
6+
7+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8+
59### Fixed
610
711- 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
141141</body >
142142```
143143
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+
144159## License
145160
146161This 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 22
33## [ Unreleased]
44
5+ ### Added
6+
7+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8+
59### Fixed
610
711- 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
110110</body >
111111```
112112
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+
113128## WebAssembly
114129
115130` 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 22
33## [ Unreleased]
44
5+ ### Added
6+
7+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8+
59### Fixed
610
711- 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
144144</body >
145145```
146146
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+
147162If you'd like to load stylesheets from your filesystem, use the ` file:// ` scheme:
148163
149164``` python
Original file line number Diff line number Diff line change 22
33## [ Unreleased]
44
5+ ### Added
6+
7+ - Support for the ` data-css-inline="keep" ` attribute to enforce keeping the ` style ` tag.
8+
59### Fixed
610
711- 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
125125</body >
126126```
127127
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+
128143If you'd like to load stylesheets from your filesystem, use the ` file:// ` scheme:
129144
130145``` ruby
You can’t perform that action at this time.
0 commit comments