• Stars
    star
    5,733
  • Rank 7,110 (Top 0.2 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created about 14 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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.

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

More Repositories

1

HomeAssistant-FusionSolar

Integrate FusionSolar into your Home Assistant.
Python
60
star
2

TwitterOAuth

PHP Twitter is a (wrapper)class to communicate with the Twitter API with the use of OAuth.
PHP
59
star
3

Dropbox

PHP Dropbox is a (wrapper)class to communicate with Dropbox.
PHP
49
star
4

Home-Assistant-FusionSolar-Kiosk

Integrate FusionSolar into your Home Assistant.
Python
35
star
5

bpost

PHP
28
star
6

Akismet

PHP Akismet is a (wrapper)class to communicate with the Akismet API.
PHP
24
star
7

Bitly

PHP
22
star
8

HomeAssistant-EnergyID

Integrate EnergyID into your Home Assistant.
Python
11
star
9

dotfiles

Shell
7
star
10

Campaign-Commander-Member

PHP Campaign Commander Member is a (wrapper)class to communicate with the Campaign Commander Member API.
PHP
7
star
11

ApplePushNotifications

5
star
12

Campaign-Commander

PHP Campaign Commander is a (wrapper)class to communicate with the Campaign Commander API.
PHP
5
star
13

Active-Collab

PHP
5
star
14

DBFact

PHP
4
star
15

Twitter

DO NOT USE THIS CLASS, use: http://github.com/tijsverkoyen/TwitterOAuth
PHP
3
star
16

Docdata-Payments

PHP
3
star
17

ConvertToJUnitXML

PHP
3
star
18

Campaign-Commander-Notifications-Messaging

PHP
2
star
19

Discogs

PHP
2
star
20

Facebook

PHP
2
star
21

active-collab-generic-server

PHP
2
star
22

capistrano-sumo

Ruby
1
star
23

Clickatell

PHP
1
star
24

Teamdesk

PHP
1
star
25

capistrano-forkcms

HTML
1
star
26

Learned-while-developing-a-Chrome-Plugin

Things I've learned while developing a Chrome Plugin
CoffeeScript
1
star
27

Recreatex

PHP
1
star
28

capistrano-cachetool

Ruby
1
star
29

TinyURL

PHP
1
star
30

node-zebrix-client

JavaScript
1
star
31

node-teamleader

node.js API client for Teamleader
JavaScript
1
star
32

deployer-sumo

Sumo specific recipe for usage with Deployer
PHP
1
star
33

YourMailingListProvider

PHP
1
star
34

Cloudspeakers

PHP
1
star
35

Vimeo-Simple

PHP
1
star