Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • Charset
  • Color
  • Css
  • ErrorHandler
  • ErrorMail
  • FirePhp
  • Html
  • HtmlTag
  • SpamFilter
  • String
  • Timer
  • XmlReader

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class Css

Class for working with CSS stylesheets.

Namespace: Jyxo
Category: Jyxo
Package: Jyxo\Css
Copyright: Copyright (c) 2005-2011 Jyxo, s.r.o.
License: https://github.com/jyxo/php/blob/master/license.txt
Author: Jaroslav HanslĂ­k
Located at Css.php
Methods summary
final public
# __construct( )

Constructor preventing from creating static class instances.

Constructor preventing from creating static class instances.

Throws

LogicException
When trying to create an instance
public static string
# repair( string $css )

Cleans up a CSS stylesheet.

Cleans up a CSS stylesheet.

Parameters

$css
string
Stylesheet definition

Returns

string
public static string
# filterProperties( string $css, array $properties, boolean $exclude = true )

Filters given properties.

Filters given properties.

Parameters

$css
string
Stylesheet definition
$properties
array
Filtered properties
$exclude
boolean
If true, $properties will be removed from the stylesheet; if false, only $properties will be left

Returns

string
public static string
# pack( string $css )

Removes unnecessary characters from a CSS stylesheet.

Removes unnecessary characters from a CSS stylesheet.

It is recommended to use the repair() method on the stylesheet definition first.

Parameters

$css
string
Stylesheet definition

Returns

string
public static string
# convertStyleToInline( string $html )

Converts HTML styles inside <style> elements to inline styles.

Converts HTML styles inside <style> elements to inline styles.

Supported selectors:

  • a {...}
  • #header {...}
  • .icon {...}
  • h1#header {...}
  • a.icon.small {...}
  • a#remove.icon.small {...}
  • a img {...}
  • h1, h2 {...}
  • a:link {...} - converts to a {...}

Parameters

$html
string
Processed HTML source

Returns

string
Jyxo PHP Library API documentation generated by ApiGen 2.3.0