Css
extends AbstractCss
in package
Pop CSS class
Tags
Table of Contents
Properties
- $classes : array<string|int, mixed>
- Classes
- $comments : array<string|int, mixed>
- Comments
- $elements : array<string|int, mixed>
- Elements
- $ids : array<string|int, mixed>
- IDs
- $media : array<string|int, mixed>
- Media queries
- $minify : bool
- Minify flag
- $selectors : array<string|int, mixed>
- Selectors
Methods
- __construct() : mixed
- CSS object constructor
- __toString() : string
- To string method
- addComment() : static
- Add CSS comment
- addMedia() : Css
- Add media query
- addSelector() : AbstractCss
- Add CSS selector
- addSelectors() : AbstractCss
- Add CSS selectors
- count() : int
- Method to get the count of properties
- getAllMedia() : array<string|int, mixed>
- Get all media queries
- getComments() : array<string|int, mixed>
- Get CSS comments
- getIterator() : ArrayIterator
- Method to iterate over the properties
- getMedia() : Media|null
- Get media query by index
- getSelector() : Selector|null
- Get CSS selector
- hasComments() : bool
- Has CSS comments
- hasSelector() : bool
- Check if the object has CSS selector
- isMinified() : bool
- Check if minify flag is set
- minify() : AbstractCss
- Set minify flag
- offsetExists() : bool
- ArrayAccess offsetExists
- offsetGet() : mixed
- ArrayAccess offsetGet
- offsetSet() : void
- ArrayAccess offsetSet
- offsetUnset() : void
- ArrayAccess offsetUnset
- parseCss() : Css
- Parse CSS string
- parseCssFile() : Css
- Parse CSS string from file
- parseCssUri() : Css
- Parse CSS string from URI
- parseFile() : Css
- Parse CSS from file
- parseString() : Css
- Parse CSS string
- parseUri() : Css
- Parse CSS from URI
- removeAllMedia() : Css
- Remove all media queries
- removeMedia() : Css
- Remove media query by index
- removeSelector() : AbstractCss
- Get CSS selector
- render() : string
- Method to render the selector CSS
- writeToFile() : void
- Method to write CSS to file
- loadArgument() : void
- Load argument
- parseSelectors() : array<string|int, mixed>
- Method to parse the CSS selectors from a string
Properties
$classes
Classes
protected
array<string|int, mixed>
$classes
= []
$comments
Comments
protected
array<string|int, mixed>
$comments
= []
$elements
Elements
protected
array<string|int, mixed>
$elements
= []
$ids
IDs
protected
array<string|int, mixed>
$ids
= []
$media
Media queries
protected
array<string|int, mixed>
$media
= []
$minify
Minify flag
protected
bool
$minify
= false
$selectors
Selectors
protected
array<string|int, mixed>
$selectors
= []
Methods
__construct()
CSS object constructor
public
__construct() : mixed
__toString()
To string method
public
__toString() : string
Return values
stringaddComment()
Add CSS comment
public
addComment(Comment|string $comment[, int $wrap = 80 ][, bool $trailingNewLine = false ]) : static
Parameters
- $comment : Comment|string
- $wrap : int = 80
- $trailingNewLine : bool = false
Return values
staticaddMedia()
Add media query
public
addMedia(Media $media) : Css
Parameters
- $media : Media
Return values
CssaddSelector()
Add CSS selector
public
addSelector(Selector $selector) : AbstractCss
Parameters
- $selector : Selector
Return values
AbstractCssaddSelectors()
Add CSS selectors
public
addSelectors(array<string|int, mixed> $selectors) : AbstractCss
Parameters
- $selectors : array<string|int, mixed>
Return values
AbstractCsscount()
Method to get the count of properties
public
count() : int
Return values
intgetAllMedia()
Get all media queries
public
getAllMedia() : array<string|int, mixed>
Return values
array<string|int, mixed>getComments()
Get CSS comments
public
getComments() : array<string|int, mixed>
Return values
array<string|int, mixed>getIterator()
Method to iterate over the properties
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetMedia()
Get media query by index
public
getMedia(int $i) : Media|null
Parameters
- $i : int
Return values
Media|nullgetSelector()
Get CSS selector
public
getSelector(string $selector) : Selector|null
Parameters
- $selector : string
Return values
Selector|nullhasComments()
Has CSS comments
public
hasComments() : bool
Return values
boolhasSelector()
Check if the object has CSS selector
public
hasSelector(string $selector) : bool
Parameters
- $selector : string
Return values
boolisMinified()
Check if minify flag is set
public
isMinified() : bool
Return values
boolminify()
Set minify flag
public
minify([bool $minify = true ]) : AbstractCss
Parameters
- $minify : bool = true
Return values
AbstractCssoffsetExists()
ArrayAccess offsetExists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
ArrayAccess offsetGet
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
ArrayAccess offsetSet
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
Tags
offsetUnset()
ArrayAccess offsetUnset
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
parseCss()
Parse CSS string
public
parseCss(string $cssString) : Css
Parameters
- $cssString : string
Return values
CssparseCssFile()
Parse CSS string from file
public
parseCssFile(string $cssFile) : Css
Parameters
- $cssFile : string
Tags
Return values
CssparseCssUri()
Parse CSS string from URI
public
parseCssUri(string $cssUri) : Css
Parameters
- $cssUri : string
Return values
CssparseFile()
Parse CSS from file
public
static parseFile(string $cssFile) : Css
Parameters
- $cssFile : string
Tags
Return values
CssparseString()
Parse CSS string
public
static parseString(string $cssString) : Css
Parameters
- $cssString : string
Return values
CssparseUri()
Parse CSS from URI
public
static parseUri(string $cssUri) : Css
Parameters
- $cssUri : string
Return values
CssremoveAllMedia()
Remove all media queries
public
removeAllMedia() : Css
Return values
CssremoveMedia()
Remove media query by index
public
removeMedia(int $i) : Css
Parameters
- $i : int
Return values
CssremoveSelector()
Get CSS selector
public
removeSelector(string $selector) : AbstractCss
Parameters
- $selector : string
Return values
AbstractCssrender()
Method to render the selector CSS
public
render() : string
Return values
stringwriteToFile()
Method to write CSS to file
public
writeToFile(string $filename) : void
Parameters
- $filename : string
loadArgument()
Load argument
protected
loadArgument(mixed $arg) : void
Parameters
- $arg : mixed
parseSelectors()
Method to parse the CSS selectors from a string
protected
parseSelectors(string $cssString) : array<string|int, mixed>
Parameters
- $cssString : string