css_inline 0.22.1 → 0.23.1

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: 7bdb9e863d0c4b1d333dbab94beb014c8884308dcc0d78731ed5706f8468a300
4
- data.tar.gz: ce1097ee0ac4313ad964607c17fb31ead1abf79d082a8afc1e95a65fe25a100d
3
+ metadata.gz: 6a6d9890334533f3c323b4035c9c6284512d5343af3eb6e8b7fd1180c086b25f
4
+ data.tar.gz: ffcfe2dfe78b198a2214337cbd2de034b06a21e3fab7614551668e2b39070e1a
5
5
  SHA512:
6
- metadata.gz: 172a49c2daa9b63e608e2919124e00edc48d3419cd9a96eece513c9990dc187f638764c08520bddb226e6a54068a4ef4792209be4fb32d245a89505936ea4a41
7
- data.tar.gz: 70058af033f406d517bb14c064f55d79886824ab417fc7dc6cd93a75edeb8f6c5faeeb55af1ecdca8f7efac86098d04358c4d6fe90ae0fba0ef66c98fbdcca9b
6
+ metadata.gz: f63528f54aeca352d5bb2f843f136dfba65baaa6227cf138dd7cbf96d9a7dba94614337d2c946126a761480eb1365be5e7fa014b34468a28ad86c76dddbb7370
7
+ data.tar.gz: fd50571a5e2a4aaa11c20a67381730238df21e263e87e1b9b73a0c6165a1b3e1f6c38ec610b62817fe17b8d9a7698a5973f3c6d63ac1de95486540304ca22cbd
data/README.md CHANGED
@@ -161,6 +161,7 @@ The module functions accept the same keyword arguments, for example `CSSInline.i
161
161
  - `remove_inlined_selectors`. Remove inlined selectors from `<style>` blocks. Default: `false`
162
162
  - `apply_width_attributes`. Add `width` HTML attributes from CSS `width` properties on `table`, `td`, `th` and `img`. Default: `false`
163
163
  - `apply_height_attributes`. Add `height` HTML attributes from CSS `height` properties on `table`, `td`, `th` and `img`. Default: `false`
164
+ - `resolve_css_variables`. Replace `var()` references with the values of the custom properties they refer to and drop the `--*` declarations. Default: `false`
164
165
 
165
166
  To skip CSS inlining for an HTML tag, add the `data-css-inline="ignore"` attribute to it:
166
167
 
@@ -270,19 +271,19 @@ end
270
271
 
271
272
  ## Performance
272
273
 
273
- `css_inline` runs 8.1x to 354x faster than `roadie` and 57x to 123x faster than `premailer` on these documents:
274
+ `css_inline` runs 9.6x to 583x faster than `roadie` and 64x to 191x faster than `premailer` on these documents:
274
275
 
275
- | | Size | `css_inline 0.22.0` | `roadie 5.2.1` | `premailer 1.27.0` |
276
+ | | Size | `css_inline 0.23.1` | `roadie 5.2.1` | `premailer 1.27.0` |
276
277
  |-------------------|---------|---------------------|-------------------------|-------------------------|
277
- | Basic usage | 230 B | 5.84 µs | 168.88 µs (**28.92x**) | 331.07 µs (**56.69x**) |
278
- | Realistic email 1 | 8.58 KB | 87.66 µs | 713.78 µs (**8.14x**) | 6.95 ms (**79.28x**) |
279
- | Realistic email 2 | 4.30 KB | 50.45 µs | 1.98 ms (**39.25x**) | ERROR |
280
- | GitHub Page | 1.81 MB | 19.01 ms | 6.73 s (**354.02x**) | 2.34 s (**123.09x**) |
278
+ | Basic usage | 230 B | 5.21 µs | 169.05 µs (**32.44x**) | 333.58 µs (**64.01x**) |
279
+ | Realistic email 1 | 8.58 KB | 74.13 µs | 711.24 µs (**9.59x**) | 7.00 ms (**94.44x**) |
280
+ | Realistic email 2 | 4.30 KB | 42.57 µs | 1.90 ms (**44.70x**) | ERROR |
281
+ | GitHub Page | 1.81 MB | 12.01 ms | 7.00 s (**582.78x**) | 2.30 s (**191.36x**) |
281
282
 
282
283
  `premailer` fails on "Realistic email 2" with `ArgumentError: Cannot parse 0 calc((100% - 500px) / 2)`.
283
284
 
284
285
  Inputs come from [`benchmarks/benchmarks.json`](https://github.com/Stranger6667/css-inline/blob/master/benchmarks/benchmarks.json): Basic usage is `simple`, Realistic email 1 and 2 are `big_email_1` and `big_email_2`, GitHub Page is `big_page`.
285
- The benchmark code is in [`test/bench.rb`](https://github.com/Stranger6667/css-inline/blob/master/bindings/ruby/test/bench.rb) and uses [`benchmark-ips`](https://github.com/evanphx/benchmark-ips) (5 s per case; `roadie` completes one run on the GitHub page in that time).
286
+ The benchmark code is in [`test/bench.rb`](https://github.com/Stranger6667/css-inline/blob/master/crates/css-inline-ruby/test/bench.rb) and uses [`benchmark-ips`](https://github.com/evanphx/benchmark-ips) (5 s per case; `roadie` completes one run on the GitHub page in that time).
286
287
  We measured these results with stable `rustc 1.99` on Ruby `3.4.8`, Ryzen 9 9950X.
287
288
 
288
289
  ## Further reading