Csstoinlinestyles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.
Alternatives To Csstoinlinestyles
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Critical9,7971,1621298 days ago96April 10, 202340apache-2.0JavaScript
Extract & Inline Critical-path CSS in HTML pages
Radium7,4425,009728a year ago73March 02, 202283mitJavaScript
A toolchain for React component styling.
Csstoinlinestyles5,70248,0542144 months ago23December 08, 202131bsd-3-clausePHP
CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.
Reactcss1,5743,8182314 years ago26September 07, 20176mitJavaScript
:lipstick: Inline Styles in JS
Responsive Html Email Signature741
4 months ago16March 29, 202210mitHTML
✨ Template generator for (responsive) emails & email signatures
Material Auto Rotating Carousel4325457 months ago28August 21, 201931mitJavaScript
Introduce users to your app with this Material-style carousel.
Reactscrollbar419285803 years ago22April 18, 201958mitJavaScript
Scrollbar component for React
Unistyle316688 years ago9January 27, 20162JavaScript
Write modular and scalable CSS using the next version of ECMAScript
Babel Plugin Css In Js2952756 years ago15January 22, 20176mitJavaScript
A plugin for Babel v6 which transforms inline styles defined in JavaScript modules into class names so they become available to, e.g. the `className` prop of React elements. While transforming, the plugin processes all JavaScript style definitions found and bundles them up into a CSS file, ready to be requested from your web server.
Material Ui Image213722110 months ago33April 24, 202126mitJavaScript
Material style image with loading animation
Alternatives To Csstoinlinestyles
Select To Compare


Alternative Project Comparisons
Readme

CssToInlineStyles class

CI

About

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.

Installation

The recommended installation way is through Composer.

$ composer require tijsverkoyen/css-to-inline-styles

Example

use TijsVerkoyen\CssToInlineStyles\CssToInlineStyles;

// create instance
$cssToInlineStyles = new CssToInlineStyles();

$html = file_get_contents(__DIR__ . '/examples/sumo/index.htm');
$css = file_get_contents(__DIR__ . '/examples/sumo/style.css');

// output
echo $cssToInlineStyles->convert(
    $html,
    $css
);

Known issues

  • no support for pseudo selectors
  • no support for css-escapes
  • UTF-8 charset is not always detected correctly. Make sure you set the charset to UTF-8 using the following meta-tag in the head: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />. (Note: using <meta charset="UTF-8"> does NOT work!)

Sites using this class

Popular Inline Projects
Popular Inline Styles Projects
Popular Text Processing Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Html
Php
Inline
Inline Styles