ParseCSSProperties

This class converts into an array the CSS properties associated with a particular CSS Selector

package

Docxpresso

subpackage

Parser

Methods

Construct

__construct() 
access

public

Converts cmyk colors to hexadecimal

_cmyk2hex(array $color) : string
access

private

Arguments

$color

array

Response

string

Converts hsl colors to hexadecimal

_hsl2hex(array $color) : string
access

private

Arguments

$color

array

Response

string

Normailzes a size property like width or height returning an array with the numeric data and the used unit. The units returned are pt, % , em or rem (all other units are converted to one of these types).

_normalizedSizeProp(string $prop) : void

The case 'auto' is treated separately to handle the centering of tables and other block level elements

access

private

Arguments

$prop

string

containing the single raw CSS properies

Parses the CSS background property The available properties are: background-color, background-position, background-size, (not parsed) background-repeat, background-origin, (not parsed) background-clip, (not parsed) background-attachment, (not parsed) background-image.

_parse_background(string $key, string $value, boolean $important = false) : void

The corresponding ODF attributes are described in the corresponding specific CSS properties like 'background-color'

access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS background-color property It may be given in different formats: 1. Hexadecimal: #FF0000 2. RGB: rgb(255, 0, 0) 3. RGBA: rgba(255,0,0,0.3) 4. CMYK: device-cmyk(0.5, 0.1, 0.0, 0.2) 5. HSL: hsl(120,100%,50%); 6. HSLA: hsla(120,100%,50%,0.3) 7. "transparent" 8. string: red, .

_parse_background_color(string $key, string $value, boolean $important = false) : void

.. Other possible values are: inherited or initial that are not parsed The corresponding ODF attributes are paragraphs-> does not apply directly but via style:text-properties text-> fo:background-color tables-> fo:background-color rows-> fo:background-color cells-> fo:background-color frames-> fo:background-color Regarding the opacity it applies to: paragraphs-> style:background-transparency

access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS background-image property It should have the form url(path to the image) The corresponding ODF attributes are stored in the style:background-image element in the xlink:href attribute and it applies to: graphics layout paragraphs sections tables rows table cells

_parse_background_image(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS background-position property The corresponding ODF attributes are stored in the style:background-image element in the style:position attribute and it applies to: graphics layout paragraphs sections tables rows table cells It follows the standard CSS syntax

_parse_background_position(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS background-repeat property The parsed values are repeat and no-repeat (there is no support for repeat-x or repeat-y) The corresponding ODF attributes are stored in the style:background-image element in the style:position attribute and it applies to: graphics layout paragraphs sections tables rows table cells It follows the standard CSS syntax

_parse_background_repeat(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border property Delegates into: _parse_border_bottom _parse_border_left _parse_border_right _parse_border_top It applies to basically all ODF elements and it follows the standard CSS syntax

_parse_border(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-bottom property Delegates into: _parse_border_bottom_color _parse_border_bottom_style _parse_border_bottom_width The corresponding ODF property is fo:border that follows the standard CSS syntax

_parse_border_bottom(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-bottom-color property This has no direct ODF translation and it should be compund to build a shorthand border_bottom property with standard CSS syntax

_parse_border_bottom_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-bottom-style property This has no direct ODF translation and it should be compund to build a shorthand border_bottom property with standard CSS syntax

_parse_border_bottom_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-bottom-width property This has no direct ODF translation and it should be compund to build a shorthand border_bottom property with standard CSS syntax

_parse_border_bottom_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-collapse property The parsed values are separate and collapse This property only applies to tables.

_parse_border_collapse(string $key, string $value, boolean $important = false) : void

The ODF equivalent is: table:border-model (collapsing or separating)

access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-color property This has no direct ODF translation and it should be compund to build a shorthand border property with standard CSS syntax

_parse_border_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-left property Delegates into: _parse_border_left_color _parse_border_left_style _parse_border_left_width

_parse_border_left(string $key, string $value, boolean $important = false) : void
see \Docxpresso\Parser\_parse_border
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-left-color property This has no direct ODF translation and it should be compund to build a shorthand border_left property with standard CSS syntax

_parse_border_left_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-left-style property This has no direct ODF translation and it should be compund to build a shorthand border_left property with standard CSS syntax

_parse_border_left_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-left-width property This has no direct ODF translation and it should be compund to build a shorthand border_left property with standard CSS syntax

_parse_border_left_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-radius property We only parsed a global value for every corner with no left/right values The equivalent ODF property is: 'draw:corner-radius' and we only apply it to ODF text-boxes

_parse_border_radius(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-right property Delegates into: _parse_border_right_color _parse_border_right_style _parse_border_right_width

_parse_border_right(string $key, string $value, boolean $important = false) : void
see \Docxpresso\Parser\_parse_border
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-right-color property This has no direct ODF translation and it should be compund to build a shorthand border_right property with standard CSS syntax

_parse_border_right_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-right-style property This has no direct ODF translation and it should be compund to build a shorthand border_right property with standard CSS syntax

_parse_border_right_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-right-width property This has no direct ODF translation and it should be compund to build a shorthand border_right property with standard CSS syntax

_parse_border_right_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-spacing property TODO: is not yet clear how to parse this property

_parse_border_spacing(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-style property This has no direct ODF translation and it should be compund to build a shorthand border property with standard CSS syntax

_parse_border_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-top property Delegates into: _parse_border_top_color _parse_border_top_style _parse_border_top_width

_parse_border_top(string $key, string $value, boolean $important = false) : void
see \Docxpresso\Parser\_parse_border
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-top-color property This has no direct ODF translation and it should be compund to build a shorthand border_top property with standard CSS syntax

_parse_border_top_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-top-style property This has no direct ODF translation and it should be compund to build a shorthand border_top property with standard CSS syntax

_parse_border_top_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-top-width property This has no direct ODF translation and it should be compund to build a shorthand border_top property with standard CSS syntax

_parse_border_top_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS border-width property This has no direct ODF translation and it should be compund to build a shorthand border_top property with standard CSS syntax

_parse_border_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS bottom property WARNING: There is no equivalent ODF attribute

_parse_bottom(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS box-shadow property The equivalent ODF attribute is: style:shadow This property follows the CSS standard

_parse_box_shadow(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS break-after property This property is mainly used for multi-column layouts The parsed values are auto, (avoid), always,left or right The corresponding ODF attributes are paragraphs-> fo:break-after (page or column) tables-> fo:break-after (page or column) rows-> fo:break-after (page or column) frames-> not directly supported If the value is 'avoid' use the Keep with Next property instead paragraphs-> fo:keep-with-next (always) tables-> fo:keep-with-next (always) rows-> fo:keep-together (always) frames-> not directly supported

_parse_break_after(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS break-before property This property is mainly used for multi-column layouts The parsed values are auto, always,page, column, left or right The avoid option has no ODF equivalent use instead break-after: avoid with the previous paragraph or element The corresponding ODF attributes are paragraphs-> fo:break-before (page or column) tables-> fo:break-before (page or column) rows-> fo:break-before (page or column) frames-> not directly supported

_parse_break_before(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS break-inside property This property is mainly used for multi-column layouts The parsed values are auto, avoid, avoid-page or avoid-column The corresponding ODF attributes are paragraphs-> fo:keep-together (always) tables-> style:may-break-between-rows (boolean) rows-> fo:keep-together (always) frames->do not apply

_parse_break_inside(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS clear property WARNING: There is no qequivalent ODF attribute

_parse_clear(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS clip property The equivalent ODF attribute is: fo:clip This property follows the CSS standard

_parse_clip(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS color property This property is inherited Its default value is #000000

_parse_color(string $key, string $value, boolean $important = false) : void

It may be given in different formats:

  1. Hexadecimal: #FF0000
  2. RGB: rgb(255, 0, 0)
  3. RGBA: rgba(255,0,0,0.3)
  4. CMYK: device-cmyk(0.5, 0.1, 0.0, 0.2)
  5. HSL: hsl(120,100%,50%);
  6. HSLA: hsla(120,100%,50%,0.3)
  7. "transparent"
  8. string: red, ... Other possible values are: inherited or initial that are ignored The corresponding ODF attributes are paragraphs-> does not apply text-> fo:color tables-> does not apply rows-> does not apply frames-> does not apply Whenever the opacity may apply it corresponds to attributes like svg:stroke-opacity or style:background-transparency
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS column-count property This value is an integer (number of columns) The corresponding ODF attribute is: fo:column-count that belongs to the element style:columns

_parse_column_count(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS column-gap property This value is given as a length The corresponding ODF attributes are: fo:start-indent fo:end-indent the gap should be splitted between both elements that belongs to the element style:column

_parse_column_gap(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS column-rule property

_parse_column_rule(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS column-rule-color property This corresponds to the ODF attribute: style:color of the style:column-sep element

_parse_column_rule_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS column-rule-style property Only the dashed, dotted and solid values are parsed This corresponds to the ODF attribute: style:style of the style:column-sep element

_parse_column_rule_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS column-rule-width property This corresponds to the ODF attribute: style:width of the style:column-sep element

_parse_column_rule_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS column-width property This corresponds to the ODF attribute: style:rel-width of the style:column element

_parse_column_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS columns property

_parse_columns(string $key, string $value, boolean $important = false) : void
see \Docxpresso\Parser\_parse_column_count \Docxpresso\Parser\_parse_column_width
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS counter-increment property

_parse_counter_increment(string $key, string $value) : void
access

private

Arguments

$key

string

$value

string

Parses the CSS counter-reset property

_parse_counter_reset(string $key, string $value) : void
access

private

Arguments

$key

string

$value

string

Parses the CSS direction property The parsed values are ltr and rtl The correspnding ODF attributes are: style:writing-mode It only applies to text and follows the XSL standard

_parse_direction(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS display property This property has no ODF equivalent but it used in the parsing of the HTML tree

_parse_display(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS empty-cells property The parsed values are show (default) or hide There is not a corresponding ODF property but we will take into account this property when rendering a particular empty table cell

_parse_empty_cells(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS float property This property has structural consequences and it is not directly parsed into a ODF property

_parse_float(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS font property and returns the following CSS properties if defined: font-style, font-variant, font-weight, font size, line-height and font-family

_parse_font(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS font-family property The corresponding ODF attributes are fo:font-family It only applies to text and follows the XSL standard

_parse_font_family(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS font-kerning property it could be auto, normal or none The corresponding ODF attributes are style:letter-kerning It only applies to text and follows the XSL standard

_parse_font_kerning(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS font-size property The parsed values include: medium, xx-small, x-small, small, large, x-large, xx-large, smaller, larger and length (10pt, 12px, 1.0em, .

_parse_font_size(string $key, string $value, boolean $important = false) : void

..) The correspnding ODF attributes are: fo:font-size fo:font-size-asian fo:font-size-complex

access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS font-style property The parsed variables are normal, italic and oblique The correspnding ODF attributes are: fo:font-style svg:font-style It only applies to text and follows the XSL standard

_parse_font_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS font-variant property The parsed variables are normaland small-caps The correspnding ODF attributes are: fo:font-variant svg:font-variant It only applies to text and follows the XSL standard

_parse_font_variant(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS font-weight property All CSS values are parse but bolder and lighter The correspnding ODF attributes are: fo:font-weight fo:font-weight-asian fo:font-weight-complex svg:font-weight It only applies to text and follows the XSL standard

_parse_font_weight(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS height property The corresponding ODF attributes are svg:height

_parse_height(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS hyphens property The parsed values are none or auto (manual has no ODF equivalent) The corresponding ODF attributes are fo:hyphenate that corresponds to the XSL standard

_parse_hyphens(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS left property This does not translate directly into an ODF property

_parse_left(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS letter-spacing property The corresponding ODF attributes are fo:letter-spacing that corresponds to the XSL standard

_parse_letter_spacing(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS line-break property The corresponding ODF attributes are style:line-break It only applies to paragraphs

_parse_line_break(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS line-height property The corresponding ODF attributes are fo:line-height It only applies to paragraphs and follows the XSL standard

_parse_line_height(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS list-style property This property may include list-style-type list-style-position list-style-image

_parse_list_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS list-style-image property The corresponding ODF property goes under the xlink:href attribute of the text:list-level-style-image element

_parse_list_style_image(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS list-style-type property The parsed values are: disc circle decimal decimal-leading-zero lower-alpha lower-greek lower-latin lower-roman none square upper-alpha upper-latin upper-roman The corresponding ODF properties are organized in a completely different manner.

_parse_list_style_type(string $key, string $value, boolean $important = false) : void

The numberings go under the style:num-format attribute of the the text:list-level-style-number element with possible values: 1, i, I, a or A The bullets go under the text:bullet-char attribute of the text:list-level-bullet-style element as an unicode character

access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS margin property This property is parse via margin-bottom, margin-left, margin-right and margin-top

_parse_margin(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS margin-bottom property The corresponding ODF property is: fo:margin-bottom

_parse_margin_bottom(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS margin-left property The corresponding ODF property is: fo:margin-left

_parse_margin_left(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS margin-right property The corresponding ODF property is: fo:margin-right

_parse_margin_right(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS margin-top property The corresponding ODF property is: fo:margin-top

_parse_margin_top(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS max-height property The corresponding ODF attributes are fo:max-height style:footnote-max-height that corresponds to the XSL standard

_parse_max_height(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS max-width property The corresponding ODF attributes are fo:max-width that corresponds to the XSL standard

_parse_max_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS min-height property The corresponding ODF attributes are fo:min-height that corresponds to the XSL standard

_parse_min_height(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS min-width property The corresponding ODF attributes are fo:min-width that corresponds to the XSL standard

_parse_min_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS opacity property The value should be higher than 0 and smaller than 1 The corresponding ODF attribute is given by style:background-transparency

_parse_opacity(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS orphans property This property stablishes the minimum number of lines that should be left in the last paragraph of a page The corresponding ODF attributes are paragraphs-> fo:orphans (positive integer value)

_parse_orphans(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS outline property Warning: it is parsed as standard border property

_parse_outline(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS outline-color property Warning: it is parsed as standard border-color property

_parse_outline_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS outline-offset property WARNING: not parsed used padding instead

_parse_outline_offset(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS outline-style property Warning: it is parsed as standard border-style property

_parse_outline_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS outline-width property Warning: it is parsed as standard border-width property

_parse_outline_width(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS padding property This property is parse via padding-bottom, padding-left, padding-right and padding-top

_parse_padding(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS padding-bottom property The corresponding ODF property is: fo:padding-bottom

_parse_padding_bottom(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS padding-left property The corresponding ODF property is: fo:padding-left

_parse_padding_left(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS padding-right property The corresponding ODF property is: fo:padding-right

_parse_padding_right(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS padding-top property The corresponding ODF property is: fo:padding-top

_parse_padding_top(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS page-break-after property The parsed values are auto, (avoid), always,left or right The corresponding ODF attributes are paragraphs-> fo:break-after (page) tables-> fo:break-after (page) rows-> fo:break-after (page) frames-> not directly supported If the value is 'avoid' use the Keep with Next property instead paragraphs-> fo:keep-with-next (always) tables-> fo:keep-with-next (always) rows-> fo:keep-together (always) frames-> not directly supported

_parse_page_break_after(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS page-break-before property The parsed values are auto, always,left or right The avoid option has no ODF equivalent use instead page-break-after: avoid with the previous paragraph or element The corresponding ODF attributes are paragraphs-> fo:break-before (page) tables-> fo:break-before (page) rows-> fo:break-before (page) frames-> not directly supported

_parse_page_break_before(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS page-break-inside property The parsed values are auto or avoid The corresponding ODF attributes are paragraphs-> fo:keep-together (always) tables-> style:may-break-between-rows (boolean) rows-> fo:keep-together (always) frames are always within a page

_parse_page_break_inside(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses an internal DOCXPRESSO property

_parse_parentstyleid(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS position property This is not directly parsed into an ODF property but has structural implications

_parse_position(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS right property This is not directly parsed into an ODF property but has structural implications

_parse_right(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS table-layout property The parsed values include auto and fixed The corresponding ODF style property is: 'style:use-optimal-column-width' that applies to table columns only

_parse_table_layout(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-align property The corresponding ODF attributes are fo:text-align It only applies to paragraphs and follows the XSL standard

_parse_text_align(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-align-last property The corresponding ODF attributes are fo:text-align-last It is ignored if it is not accompanied with a fo:text-align attribute It only applies to paragraphs and follows the XSL standard

_parse_text_align_last(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-decoration property The parsed values are: underline and line-trough Depending on its value this maps into the ODF attributes style:text-underline-type (single) style:text-line-through-type (single) style:text-overline-type (single)

_parse_text_decoration(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-decoration-color property Depending on the value of the text-decoration property this maps into the ODF attributes style:text-underline-color(single) style:text-line-through-color (single)

_parse_text_decoration_color(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-decoration-line property

_parse_text_decoration_line(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-decoration-style property Determines the line style defined trough the text-decoration-line property The possible values are: double, dotted, dashed, wavy Depending on the value the text-decoration-line property this maps into the ODF attributes style:text-underline-type (double) style:text-line-through-type (double) style:text-underline-style (single) style:text-line-through-style (single)

_parse_text_decoration_style(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-align property The corresponding ODF attributes are fo:text-indent It only applies to paragraphs and follows the XSL standard

_parse_text_indent(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-shadow property The corresponding ODF attributes are fo:text-shadow It only applies to text and follows the XSL standard

_parse_text_shadow(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS text-transform property The parsed values are: capitalize, uppercase or lowercase The ODF equivalent property is fo:text-trasform fo:text-transform and fo:font-variant attributes are mutually exclusive

_parse_text_transform(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS top property This is not directly parsed into an ODF property but has structural implications

_parse_top(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS transform property Warning: only text rotations are taking into account The corresponding ODF property is style:text-rotation angle

_parse_transform(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS vertical-align property The corresponding ODF attributes are style:vertical-align

_parse_vertical_align(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS visibility property This is not directly parsed into an ODF property but it is usesd to build the HTML tree.

_parse_visibility(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS widows property This property stablishes the minimum number of lines that should contain the first paragraph of a page when it is the continuation of a paragraph of the previous page The corresponding ODF attributes are paragraphs-> fo:widows (positive integer value)

_parse_widows(string $key, string $value) : void
access

private

Arguments

$key

string

$value

string

Parses the CSS width property The corresponding ODF attributes are svg:width

_parse_width(string $key, string $value, boolean $important) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS writing-mode property The parsed values are lr-tb, rl-tb, tb-rl, tb-lr, lr, rl, tb The correspnding ODF attributes are: style:writing-mode It only applies to text and follows the XSL standard

_parse_writing_mode(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS z-index property The corresponding ODF attributes are draw:z-index

_parse_z_index(string $key, string $value, boolean $important = false) : void
access

private

Arguments

$key

string

$value

string

$important

boolean

Parses the CSS properties asoociated with a particular CSS selector

_parseSingleCSSProp(string $prop) : void
access

private

Arguments

$prop

string

containing the single raw CSS properies

Process the CSS color property

_process_color(string $key, string $value) : void

The color may be in diffrent formats:

  1. Hexadecimal: #FF0000
  2. RGB: rgb(255, 0, 0)
  3. RGBA: rgba(255,0,0,0.3)
  4. CMYK: device-cmyk(0.5, 0.1, 0.0, 0.2)
  5. HSL: hsl(120,100%,50%);
  6. HSLA: hsla(120,100%,50%,0.3)
  7. "transparent"
  8. string: red, ... Other possible values are: inherited or initial
access

private

Arguments

$key

string

$value

string

Process shorthand properties for margin and padding

_process_shorthand(string $value) : array
access

private

Arguments

$value

string

Response

array

Converts rgb colors to hexadecimal red: 0-255 green: 0-255 blue: 0-255

_rgb2hex(array $color) : string
access

private

Arguments

$color

array

Response

string

Parses the CSS properties asoociated with a particular CSS selector

parseCSS(string $CSSProperties) : array
access

public

Arguments

$CSSProperties

string

Response

array

with the parsed properties in a standard form

Properties

CSSPropslexer instance

_CSSPropsLexer : \Docxpresso\Parser\CSSPropsLexer
var
access

private

Type(s)

\Docxpresso\Parser\CSSPropsLexer

parsedCSSProps

_importantProps : array
var

parsedCSSProps

access

private

Type(s)

array

parsedCSSProps

_parsedCSSProps : array
var

parsedCSSProps

access

private

Type(s)

array