css_inline 0.23.1-aarch64-linux-musl → 0.25.0-aarch64-linux-musl

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eda0b156d2572d02ba3dd3f7553d202c0fc897f7c36491324d6b806c02205ab
4
- data.tar.gz: 0ebbdd2c26a4a3ecfb90788e26e918d6e25a704bc67353538228891e347d914b
3
+ metadata.gz: 6e6cc25ccbea69dadc2ef05a4ccabe4e7a7a4d634d8c86f7275b542a80287340
4
+ data.tar.gz: 73ffb2ee790802b99476295b22a97aa6edbf4a33088c47e7cbf7dd61d0029269
5
5
  SHA512:
6
- metadata.gz: e3a1a08fcc618f791fdcc3eeb2d40fdc72fb4d1c8c04122d35457ae4d1d8c535182dd558e244553372c6fa245b86f96d8bfb638b58658bb90b9e3ee58e2df79f
7
- data.tar.gz: cdf713bb17a0e2b9fd6a618d0f90017c6da620a699b2efb27a7b8e02e4f7f9e35924fe368340dddd19376e072536524d8d9ddfc79cdc1965f52633b1e2277fbb
6
+ metadata.gz: ca5f8796ecee20b8a238850fece74a00bccf9df55fbe3020eacdb10a4e7ea344176ee03e2bde769ad2b4f2c235750c13ffc776deba3b0a424da98114ddcb862f
7
+ data.tar.gz: 6ae468eac12e097d5666d97175c8e3bfd5245793b66dd068c4cc55a837c1fa37be57f5447e65102038460c27df721ff7559347abf4c15634ee45cc3c65f95475
data/README.md CHANGED
@@ -3,7 +3,6 @@
3
3
  [<img alt="build status" src="https://img.shields.io/github/actions/workflow/status/Stranger6667/css-inline/build.yml?style=flat-square&labelColor=555555&logo=github" height="20">](https://github.com/Stranger6667/css-inline/actions/workflows/build.yml)
4
4
  [<img alt="ruby gems" src="https://img.shields.io/gem/v/css_inline?logo=ruby&style=flat-square" height="20">](https://rubygems.org/gems/css_inline)
5
5
  [<img alt="codecov.io" src="https://img.shields.io/codecov/c/gh/Stranger6667/css-inline?logo=codecov&style=flat-square&token=tOzvV4kDY0" height="20">](https://app.codecov.io/github/Stranger6667/css-inline)
6
- [<img alt="gitter" src="https://img.shields.io/gitter/room/Stranger6667/css-inline?style=flat-square" height="20">](https://gitter.im/Stranger6667/css-inline)
7
6
 
8
7
  `css_inline` moves CSS from `<style>` and `<link>` tags into HTML `style` attributes.
9
8
  Use it to prepare HTML emails or to embed HTML into third-party web pages.
@@ -151,7 +150,7 @@ The module functions accept the same keyword arguments, for example `CSSInline.i
151
150
  - `inline_style_tags`. Inline CSS from `style` tags. Default: `true`
152
151
  - `keep_style_tags`. Keep `style` tags after inlining. Default: `false`
153
152
  - `keep_link_tags`. Keep `link` tags after inlining. Default: `false`
154
- - `keep_at_rules`. Keep at-rules (starting with `@`) after inlining. Default: `false`
153
+ - `keep_at_rules`. Keep at-rules (starting with `@`) after inlining. Errors in fragment inlining. Default: `false`
155
154
  - `minify_css`. Remove trailing semicolons and spaces between properties and values. Default: `false`
156
155
  - `base_url`. Base URL for resolving relative URLs. Use the `file://` scheme to load stylesheets from the filesystem. Default: `nil`
157
156
  - `load_remote_stylesheets`. Load stylesheets from `link` tags, over the network or from `file://` paths. Default: `true`
@@ -162,6 +161,9 @@ The module functions accept the same keyword arguments, for example `CSSInline.i
162
161
  - `apply_width_attributes`. Add `width` HTML attributes from CSS `width` properties on `table`, `td`, `th` and `img`. Default: `false`
163
162
  - `apply_height_attributes`. Add `height` HTML attributes from CSS `height` properties on `table`, `td`, `th` and `img`. Default: `false`
164
163
  - `resolve_css_variables`. Replace `var()` references with the values of the custom properties they refer to and drop the `--*` declarations. Default: `false`
164
+ - `media_type`. Inline rules from `@media` blocks whose query lists this media type or `all`, e.g. `@media print` or `@media screen, print` for `print`. Queries with media features, such as `print and (min-width: 600px)`, never apply. An inlined block is not kept as an at-rule. Ignored when `keep_at_rules` is enabled and `inline_style_tags` is disabled. Default: `nil`
165
+ - `keep_classes`. Keep `class` attributes in the output. When disabled, class selectors in kept `<style>` blocks and at-rules match nothing. Default: `true`
166
+ - `remove_unused_at_rules`. Remove rules that match no element from kept at-rules (`@media`, `@supports`, ...), along with blocks left empty. Needs `keep_at_rules` or `remove_inlined_selectors`. Matching ignores `:hover`, `::before` and similar. This also removes rules that target markup injected by an email client (e.g. Gmail's `u ~ div .x`). Default: `false`
165
167
 
166
168
  To skip CSS inlining for an HTML tag, add the `data-css-inline="ignore"` attribute to it:
167
169
 
Binary file
Binary file
Binary file
Binary file
data/src/lib.rs CHANGED
@@ -76,6 +76,12 @@ struct Options {
76
76
  /// Substitute `var()` references with the values of the custom properties they refer to
77
77
  /// and drop the `--*` declarations from the inlined styles.
78
78
  resolve_css_variables: Option<bool>,
79
+ /// Inline rules from `@media` blocks that apply to this media type.
80
+ media_type: Option<String>,
81
+ /// Keep `class` attributes in the output.
82
+ keep_classes: Option<bool>,
83
+ /// Remove rules that match no element from the conditional at-rules (`@media`, `@supports`, ...) kept in the output.
84
+ remove_unused_at_rules: Option<bool>,
79
85
  }
80
86
 
81
87
  impl TryConvert for Options {
@@ -103,6 +109,10 @@ impl TryConvert for Options {
103
109
  .aref::<_, Option<bool>>(ruby.to_symbol("apply_height_attributes"))?,
104
110
  resolve_css_variables: h
105
111
  .aref::<_, Option<bool>>(ruby.to_symbol("resolve_css_variables"))?,
112
+ media_type: h.aref::<_, Option<String>>(ruby.to_symbol("media_type"))?,
113
+ keep_classes: h.aref::<_, Option<bool>>(ruby.to_symbol("keep_classes"))?,
114
+ remove_unused_at_rules: h
115
+ .aref::<_, Option<bool>>(ruby.to_symbol("remove_unused_at_rules"))?,
106
116
  })
107
117
  }
108
118
  }
@@ -129,6 +139,9 @@ fn parse_options<Req>(
129
139
  apply_width_attributes: kwargs.apply_width_attributes.unwrap_or(false),
130
140
  apply_height_attributes: kwargs.apply_height_attributes.unwrap_or(false),
131
141
  resolve_css_variables: kwargs.resolve_css_variables.unwrap_or(false),
142
+ media_type: kwargs.media_type,
143
+ keep_classes: kwargs.keep_classes.unwrap_or(true),
144
+ remove_unused_at_rules: kwargs.remove_unused_at_rules.unwrap_or(false),
132
145
  })
133
146
  }
134
147
 
@@ -176,7 +189,8 @@ impl From<InlineErrorWrapper> for magnus::Error {
176
189
  rust_inline::InlineError::ParseError(message) => {
177
190
  magnus::Error::new(ruby.exception_arg_error(), message.to_string())
178
191
  }
179
- rust_inline::InlineError::MissingStyleSheet { .. } => {
192
+ rust_inline::InlineError::MissingStyleSheet { .. }
193
+ | rust_inline::InlineError::UnsupportedFragmentOption => {
180
194
  magnus::Error::new(ruby.exception_arg_error(), error.0.to_string())
181
195
  }
182
196
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css_inline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.1
4
+ version: 0.25.0
5
5
  platform: aarch64-linux-musl
6
6
  authors:
7
7
  - Dmitry Dygalo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-27 00:00:00.000000000 Z
11
+ date: 2026-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler