css-inline 0.19.1__tar.gz → 0.20.1__tar.gz

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.
Files changed (34) hide show
  1. {css_inline-0.19.1 → css_inline-0.20.1}/PKG-INFO +8 -6
  2. {css_inline-0.19.1/bindings/python → css_inline-0.20.1}/README.md +7 -5
  3. {css_inline-0.19.1 → css_inline-0.20.1}/bindings/python/CHANGELOG.md +30 -1
  4. {css_inline-0.19.1 → css_inline-0.20.1}/bindings/python/Cargo.lock +116 -144
  5. {css_inline-0.19.1 → css_inline-0.20.1}/bindings/python/Cargo.toml +2 -2
  6. {css_inline-0.19.1 → css_inline-0.20.1/bindings/python}/README.md +7 -5
  7. {css_inline-0.19.1 → css_inline-0.20.1}/bindings/python/src/lib.rs +39 -17
  8. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/Cargo.toml +4 -6
  9. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/README.md +7 -3
  10. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/attributes.rs +17 -8
  11. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/document.rs +59 -1
  12. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/serializer.rs +218 -39
  13. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/lib.rs +54 -0
  14. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/main.rs +16 -0
  15. {css_inline-0.19.1 → css_inline-0.20.1}/LICENSE +0 -0
  16. {css_inline-0.19.1 → css_inline-0.20.1}/bindings/python/build.rs +0 -0
  17. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/benches/inliner.rs +0 -0
  18. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/rustfmt.toml +0 -0
  19. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/error.rs +0 -0
  20. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/element.rs +0 -0
  21. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/iter.rs +0 -0
  22. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/mod.rs +0 -0
  23. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/node.rs +0 -0
  24. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/parser.rs +0 -0
  25. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/selectors/attr_value.rs +0 -0
  26. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/selectors/local_name.rs +0 -0
  27. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/selectors/mod.rs +0 -0
  28. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/selectors/parser.rs +0 -0
  29. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/selectors/pseudo_classes.rs +0 -0
  30. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/selectors/pseudo_elements.rs +0 -0
  31. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/html/selectors/selector_impl.rs +0 -0
  32. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/parser.rs +0 -0
  33. {css_inline-0.19.1 → css_inline-0.20.1}/css-inline/src/resolver.rs +0 -0
  34. {css_inline-0.19.1 → css_inline-0.20.1}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: css-inline
3
- Version: 0.19.1
3
+ Version: 0.20.1
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -184,6 +184,8 @@ inliner.inline("...")
184
184
  - `extra_css`. Extra CSS to be inlined. Default: `None`
185
185
  - `preallocate_node_capacity`. **Advanced**. Preallocates capacity for HTML nodes during parsing. This can improve performance when you have an estimate of the number of nodes in your HTML document. Default: `32`
186
186
  - `remove_inlined_selectors`. Specifies whether to remove selectors that were successfully inlined from `<style>` blocks. Default: `False`
187
+ - `apply_width_attributes`. Specifies whether to add `width` HTML attributes from CSS `width` properties on supported elements (`table`, `td`, `th`, `img`). Default: `False`
188
+ - `apply_height_attributes`. Specifies whether to add `height` HTML attributes from CSS `height` properties on supported elements (`table`, `td`, `th`, `img`). Default: `False`
187
189
 
188
190
  You can also skip CSS inlining for an HTML tag by adding the `data-css-inline="ignore"` attribute to it:
189
191
 
@@ -297,13 +299,13 @@ Here is the performance comparison:
297
299
 
298
300
  | | Size | `css_inline 0.19.0` | `premailer 3.10.0` | `toronado 0.1.0` | `inlinestyler 0.2.5` | `pynliner 0.8.0` |
299
301
  |-------------|---------|---------------------|------------------------|-------------------------|------------------------|-------------------------|
300
- | Basic | 230 B | 4.11 µs | 94.34 µs (**22.96x**) | 509.48 µs (**124.02x**) | 1.02 ms (**248.30x**) | 852.17 µs (**207.44x**) |
301
- | Realistic-1 | 8.58 KB | 78.87 µs | 1.03 ms (**13.10x**) | 11.68 ms (**148.04x**) | 26.37 ms (**334.38x**) | 11.61 ms (**147.19x**) |
302
- | Realistic-2 | 4.3 KB | 48.27 µs | 1.49 ms (**30.81x**) | ERROR | 17.71 ms (**366.87x**) | ERROR |
303
- | GitHub page | 1.81 MB | 29.54 ms | 10.91 s (**369.13x**) | ERROR | ERROR | ERROR |
302
+ | Basic | 230 B | 4.27 µs | 85.05 µs (**19.93x**) | 495.30 µs (**116.05x**) | 1.02 ms (**238.87x**) | 867.79 µs (**203.32x**) |
303
+ | Realistic-1 | 8.58 KB | 80.59 µs | 1.03 ms (**12.76x**) | 11.55 ms (**143.29x**) | 26.37 ms (**327.21x**) | 11.71 ms (**145.36x**) |
304
+ | Realistic-2 | 4.3 KB | 46.88 µs | 1.44 ms (**30.73x**) | ERROR | 17.71 ms (**377.77x**) | ERROR |
305
+ | GitHub page | 1.81 MB | 17.57 ms | 10.78 s (**613.48x**) | ERROR | ERROR | ERROR |
304
306
 
305
307
  The "Basic" case was obtained by benchmarking the example from the Usage section.
306
- Note that the `toronado`, `inlinestyler`, and `pynliner` libraries both encountered errors when used to inline CSS in the last scenario.
308
+ Note that the `toronado`, `inlinestyler`, and `pynliner` libraries encountered errors when used to inline CSS in the last scenarios.
307
309
 
308
310
  The benchmarking code is available in the `benches/bench.py` file. The benchmarks were conducted using the stable `rustc 1.91`, Python `3.14.2` on Ryzen 9 9950X.
309
311
 
@@ -156,6 +156,8 @@ inliner.inline("...")
156
156
  - `extra_css`. Extra CSS to be inlined. Default: `None`
157
157
  - `preallocate_node_capacity`. **Advanced**. Preallocates capacity for HTML nodes during parsing. This can improve performance when you have an estimate of the number of nodes in your HTML document. Default: `32`
158
158
  - `remove_inlined_selectors`. Specifies whether to remove selectors that were successfully inlined from `<style>` blocks. Default: `False`
159
+ - `apply_width_attributes`. Specifies whether to add `width` HTML attributes from CSS `width` properties on supported elements (`table`, `td`, `th`, `img`). Default: `False`
160
+ - `apply_height_attributes`. Specifies whether to add `height` HTML attributes from CSS `height` properties on supported elements (`table`, `td`, `th`, `img`). Default: `False`
159
161
 
160
162
  You can also skip CSS inlining for an HTML tag by adding the `data-css-inline="ignore"` attribute to it:
161
163
 
@@ -269,13 +271,13 @@ Here is the performance comparison:
269
271
 
270
272
  | | Size | `css_inline 0.19.0` | `premailer 3.10.0` | `toronado 0.1.0` | `inlinestyler 0.2.5` | `pynliner 0.8.0` |
271
273
  |-------------|---------|---------------------|------------------------|-------------------------|------------------------|-------------------------|
272
- | Basic | 230 B | 4.11 µs | 94.34 µs (**22.96x**) | 509.48 µs (**124.02x**) | 1.02 ms (**248.30x**) | 852.17 µs (**207.44x**) |
273
- | Realistic-1 | 8.58 KB | 78.87 µs | 1.03 ms (**13.10x**) | 11.68 ms (**148.04x**) | 26.37 ms (**334.38x**) | 11.61 ms (**147.19x**) |
274
- | Realistic-2 | 4.3 KB | 48.27 µs | 1.49 ms (**30.81x**) | ERROR | 17.71 ms (**366.87x**) | ERROR |
275
- | GitHub page | 1.81 MB | 29.54 ms | 10.91 s (**369.13x**) | ERROR | ERROR | ERROR |
274
+ | Basic | 230 B | 4.27 µs | 85.05 µs (**19.93x**) | 495.30 µs (**116.05x**) | 1.02 ms (**238.87x**) | 867.79 µs (**203.32x**) |
275
+ | Realistic-1 | 8.58 KB | 80.59 µs | 1.03 ms (**12.76x**) | 11.55 ms (**143.29x**) | 26.37 ms (**327.21x**) | 11.71 ms (**145.36x**) |
276
+ | Realistic-2 | 4.3 KB | 46.88 µs | 1.44 ms (**30.73x**) | ERROR | 17.71 ms (**377.77x**) | ERROR |
277
+ | GitHub page | 1.81 MB | 17.57 ms | 10.78 s (**613.48x**) | ERROR | ERROR | ERROR |
276
278
 
277
279
  The "Basic" case was obtained by benchmarking the example from the Usage section.
278
- Note that the `toronado`, `inlinestyler`, and `pynliner` libraries both encountered errors when used to inline CSS in the last scenario.
280
+ Note that the `toronado`, `inlinestyler`, and `pynliner` libraries encountered errors when used to inline CSS in the last scenarios.
279
281
 
280
282
  The benchmarking code is available in the `benches/bench.py` file. The benchmarks were conducted using the stable `rustc 1.91`, Python `3.14.2` on Ryzen 9 9950X.
281
283
 
@@ -2,6 +2,33 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.20.1] - 2026-03-26
6
+
7
+ ### Changed
8
+
9
+ - Update `html5ever` to `0.39`.
10
+ - Update `selectors` to `0.36`.
11
+
12
+ ### Fixed
13
+
14
+ - `!important` lost when inlining styles onto elements with existing inline `style` attributes. [#682](https://github.com/Stranger6667/css-inline/issues/682)
15
+ - `!important` lost when `minify_css` is enabled due to separator mismatch during property lookup. [#682](https://github.com/Stranger6667/css-inline/issues/682)
16
+
17
+ ## [0.20.0] - 2026-02-07
18
+
19
+ ### Added
20
+
21
+ - `apply_width_attributes` and `apply_height_attributes` options to add dimension HTML attributes from CSS properties on supported elements (`table`, `td`, `th`, `img`). [#652](https://github.com/Stranger6667/css-inline/issues/652)
22
+
23
+ ### Changed
24
+
25
+ - Update `PyO3` to `0.28.0`.
26
+
27
+ ### Performance
28
+
29
+ - Skip selectors that reference non-existent classes, IDs, or tags.
30
+ - Faster HTML serialization for styles containing double quotes.
31
+
5
32
  ## [0.19.1] - 2026-01-23
6
33
 
7
34
  ### Changed
@@ -536,7 +563,9 @@
536
563
 
537
564
  - Initial public release
538
565
 
539
- [Unreleased]: https://github.com/Stranger6667/css-inline/compare/python-v0.19.1...HEAD
566
+ [Unreleased]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.1...HEAD
567
+ [0.20.1]: https://github.com/Stranger6667/css-inline/compare/python-v0.20.0...python-v0.20.1
568
+ [0.20.0]: https://github.com/Stranger6667/css-inline/compare/python-v0.19.1...python-v0.20.0
540
569
  [0.19.1]: https://github.com/Stranger6667/css-inline/compare/python-v0.19.0...python-v0.19.1
541
570
  [0.19.0]: https://github.com/Stranger6667/css-inline/compare/python-v0.18.0...python-v0.19.0
542
571
  [0.18.0]: https://github.com/Stranger6667/css-inline/compare/python-v0.17.0...python-v0.18.0