Media
extends AbstractCss
in package
Pop CSS media class
Tags
Table of Contents
Properties
- $classes : array<string|int, mixed>
- Classes
- $comments : array<string|int, mixed>
- Comments
- $condition : string|null
- Media condition
- $elements : array<string|int, mixed>
- Elements
- $features : array<string|int, mixed>
- Media features
- $ids : array<string|int, mixed>
- IDs
- $minify : bool
- Minify flag
- $selectors : array<string|int, mixed>
- Selectors
- $tabSize : int
- Tab size
- $type : string|null
- Media type
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- To string method
- addComment() : static
- Add CSS comment
- addSelector() : AbstractCss
- Add CSS selector
- addSelectors() : AbstractCss
- Add CSS selectors
- count() : int
- Method to get the count of properties
- getComments() : array<string|int, mixed>
- Get CSS comments
- getCondition() : string|null
- Get condition
- getFeature() : string|null
- Get feature
- getFeatures() : array<string|int, mixed>
- Get features
- getIterator() : ArrayIterator
- Method to iterate over the properties
- getSelector() : Selector|null
- Get CSS selector
- getTabSize() : int
- Get tab size
- getType() : string|null
- Get type
- hasComments() : bool
- Has CSS comments
- hasFeature() : bool
- Does media query have feature
- 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
- removeSelector() : AbstractCss
- Get CSS selector
- render() : string
- Method to render the selector CSS
- setCondition() : Media
- Set condition
- setFeature() : Media
- Set feature
- setFeatures() : Media
- Set features
- setTabSize() : Media
- Set tab size
- setType() : Media
- Set type
Properties
$classes
Classes
protected
array<string|int, mixed>
$classes
= []
$comments
Comments
protected
array<string|int, mixed>
$comments
= []
$condition
Media condition
protected
string|null
$condition
= null
$elements
Elements
protected
array<string|int, mixed>
$elements
= []
$features
Media features
protected
array<string|int, mixed>
$features
= []
$ids
IDs
protected
array<string|int, mixed>
$ids
= []
$minify
Minify flag
protected
bool
$minify
= false
$selectors
Selectors
protected
array<string|int, mixed>
$selectors
= []
$tabSize
Tab size
protected
int
$tabSize
= 4
$type
Media type
protected
string|null
$type
= null
Methods
__construct()
Constructor
public
__construct([string|null $type = null ][, array<string|int, mixed>|null $features = null ][, string|null $condition = null ][, int $tabSize = 4 ]) : mixed
Instantiate the CSS media object
Parameters
- $type : string|null = null
- $features : array<string|int, mixed>|null = null
- $condition : string|null = null
- $tabSize : int = 4
__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
staticaddSelector()
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
intgetComments()
Get CSS comments
public
getComments() : array<string|int, mixed>
Return values
array<string|int, mixed>getCondition()
Get condition
public
getCondition() : string|null
Return values
string|nullgetFeature()
Get feature
public
getFeature(string $feature) : string|null
Parameters
- $feature : string
Return values
string|nullgetFeatures()
Get features
public
getFeatures() : array<string|int, mixed>
Return values
array<string|int, mixed>getIterator()
Method to iterate over the properties
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetSelector()
Get CSS selector
public
getSelector(string $selector) : Selector|null
Parameters
- $selector : string
Return values
Selector|nullgetTabSize()
Get tab size
public
getTabSize() : int
Return values
intgetType()
Get type
public
getType() : string|null
Return values
string|nullhasComments()
Has CSS comments
public
hasComments() : bool
Return values
boolhasFeature()
Does media query have feature
public
hasFeature(string $feature) : bool
Parameters
- $feature : string
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
removeSelector()
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
stringsetCondition()
Set condition
public
setCondition([string|null $condition = null ]) : Media
Parameters
- $condition : string|null = null
Return values
MediasetFeature()
Set feature
public
setFeature(string $feature, string $value) : Media
Parameters
- $feature : string
- $value : string
Return values
MediasetFeatures()
Set features
public
setFeatures(array<string|int, mixed> $features) : Media
Parameters
- $features : array<string|int, mixed>
Return values
MediasetTabSize()
Set tab size
public
setTabSize(int $tabSize) : Media
Parameters
- $tabSize : int
Return values
MediasetType()
Set type
public
setType(string $type) : Media
Parameters
- $type : string