CSSPropsLexer

This lexer will let us to extract the relevant tokens from a compound CSS property

package

Docxpresso

subpackage

Parser

Methods

Construct

__construct() 
access

public

Extracts the value of the last ocurrence of a CSS property or the one that is tagged as !important if the property is given as astring, otherwise the property is read from the corresponding array entry.

extractSingleProperty(string $prop, string $CSS) : string
static
access

public

static

Arguments

$prop

string

the property we wish to extract

$CSS

string

the chain of CSS properties

Response

string

Classify the tokens in 4 different types: color, position, (size, ignored) repeat, (origin, ignored) (clip, ignored) (attachment, ignored) image.

tokenizeBackgroundProp(string $value) : array
access

public

Arguments

$value

string

the property that we want to parse

Response

array

with keys: 'color', 'position','repeat', image

Classify the tokens in 3 different types: width, style, color

tokenizeBorderProp(string $value) : array
access

public

Arguments

$value

string

the property that we want to parse

Response

array

with keys: width, style and color

Classify the tokens in different types: style : normal, italique, oblique, initial and inherit , variant: normal, small-caps, initial and inherit weight: normal, bold, bolder, lighter, integer initial and inherit size, line-height, family

tokenizeFontProp(string $value) : array
access

public

Arguments

$value

string

the property that we want to parse

Response

array

with keys: 'color', 'position','repeat', image

Classify the tokens in 3 different types: type, position image.

tokenizeListProp(string $value) : array
access

public

Arguments

$value

string

the property that we want to parse

Response

array

with keys: 'color', 'position','repeat', image

separates value from units and returns an array

tokenizeUnits(string $dimension) : array
static
access

public

static

Arguments

$dimension

string

the chain with the CSS units

Response

array

Properties

CSS background-clip and origin property

backgroundClipOrigin : array
static
access

public

static
var

Type(s)

array

CSS position

backgroundPosition : array
static
access

public

static
var

Type(s)

array

CSS background-repeat property

backgroundRepeat : array
static
access

public

static
var

Type(s)

array

CSS border styles

borderStyles : array
static
access

public

static
var

Type(s)

array

CSS list style types

listStyles : array
static
access

public

static
var

Type(s)

array