tijsverkoyen/css-to-inline-styles
CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.
v2.4.0
563M downloads/mo
#98 most downloaded on composer
tijsverkoyen/CssToInlineStyles
What this package is like to depend on
Last release 8 months ago
02 Dec 2025
Ships fairly regularly
a new release about every 11 months
Nearly every release is documented
notes for 27 of 28 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
28 releases · first in 2012
1 release in the last 12 months
see the full history below
Release timeline
28 releases · Oct 2012 to Dec 2025Releases
latest 28-
v2.4.002 Dec 2025Release notes
Open source →What's Changed
- Allow Symfony 8 by @nicolas-grekas in #255
- PHP 8.5: Replace deprecated
SplObjectStorage::containswithoffsetExistsby @MrPunyapal in #257
New Contributors
- @MrPunyapal made their first contribution in #257
Full Changelog: v2.3.0...v2.4.0
-
v2.3.021 Dec 2024Release notes
Open source →What's Changed
- Bump the min PHP version to PHP 7.4 by @stof in #250
- fix PHP 8.4 compatibility by @xabbuh in #247
- Remove support for unmaintained Symfony versions by @stof in #249
New Contributors
Full Changelog: v2.2.7...v2.3.0
-
v2.2.708 Dec 2023Release notes
Open source →What's Changed
- Ensure file name matches class name by @DavidPrevot in #242
- Allow Symfony 7 by @nicolas-grekas in #243
- Add a CI job on PHP 8.3 by @stof in #245
New Contributors
- @DavidPrevot made their first contribution in #242
Full Changelog: 2.2.6...v2.2.7
-
2.2.603 Jan 2023 -
2.2.512 Sep 2022 -
2.2.408 Dec 2021 -
2.2.313 Jul 2020Nothing published for this version
-
2.2.224 Oct 2019 -
2.2.127 Nov 2017Release notes
Open source →- Ignored styles that are inside html comments
- Added support for Symfony 4
-
2.2.020 Sep 2016Release notes
Open source →Changelog since 2.1.0
- Better ordering of style rules and properties, thx to Hikariii,
for more information see the Pull Request - Some Travis improvements, thx to barryvdh,
for more information see the Pull Request - Refactor the storage of the computed properties, thx to stof,
for more information see the Pull Request - Use possessive quantifiers to avoid reaching PCRE limits, thx to stof,
for more information see the Pull Request - Reuse the same CssSelectorConverter, thx to stof,
for more information see the Pull Request - Add a test for the removal of comments, thx to stof,
for more information see the Pull Request - Add the PHP requirement in the composer.json, thx to stof,
for more information see the Pull Request - Fix the detection of style tags, thx to stof,
for more information see the Pull Request - Remove the useless Selector class, thx to stof,
for more information see the Pull Request
- Better ordering of style rules and properties, thx to Hikariii,
-
2.1.005 Sep 2016Release notes
Open source →- Better ordering of style rules and properties, thx to Hikariii, for more information see the Pull Request
- Some Travis improvements, thx to barryvdh, for more information see the Pull Request
- Refactor the storage of the computed properties, thx to stof, for more information see the Pull Request
- Use possessive quantifiers to avoid reaching PCRE limits, thx to stof, for more information see the Pull Request
- Reuse the same CssSelectorConverter, thx to stof, for more information see the Pull Request
- Add a test for the removal of comments, thx to stof, for more information see the Pull Request
- Add the PHP requirement in the composer.json, thx to stof, for more information see the Pull Request
- Fix the detection of style tags, thx to stof, for more information see the Pull Request
- Remove the useless Selector class, thx to stof, for more information see the Pull Request
-
2.0.023 Feb 2016 -
1.5.508 Dec 2015Release notes
Open source →The 2.0 version is a major overhaul, which is not backwards compatible.
- From now on you can re-use the class for multiple mails.
- A lot less complicated options, as in: no more options at all.
- More separate classes which handle their own (tested) methods.
- A lot more tests
The reason why I did this was to made the class more usable.
-
1.5.401 Apr 2015Release notes
Open source →- Better README + License
- Use DOM instead of regexp in cleanupHTML()
- Use Selector class
- Fixed stripping of XML-header
- Converted $cssRules to a local variable returned by processCSS
- Allow Symfony/CssSelector 3.0
- Removed unneeded stability change
-
1.5.301 Apr 2015Release notes
Open source →- Fix properties split on base64 encoded url content, thx to tguyard, for more information see the Pull Request
- Reset the xml error handling after usage, thx to stof, for more information see the Pull Request
- Remove version from require, thx to barryvdh, for more information see the Pull Request
-
1.5.201 Aug 2014 -
1.5.125 Jul 2014Release notes
Open source →- Refactor removing style tags, thx to barryvdh, for more information see the Pull Request
- Set excludeMediaQueries to true as default, thx to barryvdh, for more information see the Pull Request
- Normalised eof and removed extra whitespace, thx to GrahamCampbell, for more information see the Pull Request
- Testing Improvements, thx to GrahamCampbell, for more information see the Pull Request
- Add note about charset, thx to barryvdh, for more information see the Pull Request
- Deprecate encoding, thx to barryvdh, for more information see the Pull Request
- Added a .gitattributes file, thx to GrahamCampbell, for more information see the Pull Request
-
1.5.025 Jul 2014Release notes
Open source →- Exclude vendor files from coverage, thx to barryvdh, for more information see the Pull Request
- Add tests for Specificity and !important, thx to barryvdh, for more information see the Pull Request
-
1.4.425 Jul 2014 -
1.4.325 Jul 2014 -
1.4.225 Jul 2014Release notes
Open source →- Refactor specificity, thx to barryvdh, for more information see the Pull Request
-
1.4.118 Jul 2014Release notes
Open source →- Ignore the composer.lock-file as it doesn't make any sense
- Tests. Massive thumbs up for jbboehr, for more information see the Pull Request
- Tweak for the
!importantattributes-fix, thx to barryvdh, for more information see the Pull Request
-
1.4.018 Jul 2014Release notes
Open source →- Skip
!importantattributes if needed, thx to barryvdh, for more information see the Pull Request
- Skip
-
1.3.005 May 2014Release notes
Open source →- Use Xpath instead of regex, thx to stof, for more information see the Pull Request
-
1.2.109 Feb 2013Release notes
Open source →- sortOnSpecifity is now working correctly, thx to lifo101, for more information see the Pull Request
-
1.2.009 Feb 2013 -
1.1.013 Oct 2012 -
1.0.613 Oct 2012