[Raku CSS Project] / [CSS-Properties] / CSS::Properties :: PropertyInfo
class CSS::Properties::PropertyInfo
Meta-data for a given property
Synopsis
use CSS::Properties::Property;
my CSS::Properties::PropertyInfo %edges = <top right bottom left>.map: {
$_ => CSS::Properties::PropertyInfo.new: :name('margin-' ~ $_);
}
my CSS::Properties::PropertyInfo $margin-info .= new: :name<margin>, :%edges;
is-deeply $margin-info.name, 'margin', '$prop.name';
say $margin-info.box; # True
say $margin-info.inherit; # False
say $margin-info.synopsis; # <margin-width>{1,4}
say $margin-info.top.name, # margin-top
Description
Information class for individual properties
Methods
new
method new(
Str :$prop-name, # property name e.g. 'margin-top'
CSS::Module :$module = CSS::Module::CSS3.new(),
CSS::Properties::PropertyInfo :%edges{ :$top, :$left, :$bottom, :$right},
) returns CSS::Properties::PropertyInfo;
Returns a new object containing inforation on the given property
Accessors
The following CSS::Module::Property accessors are handled by this object
Name | Type | Description |
---|---|---|
name | Str | Property name, e.g. 'top-margin' |
prop-num | UInt | A unique number for the property |
inherit | Bool | The property is inherited? |
initial | Bool | Property should reset to it's initial value? |
important | Bool | Property has !important inheritance mode |
synposis | Bool | Property value L<syntax|http://www.w3.org/TR/CSS21/about.html#property-defs> definition |
default-value | Any | Default value for the property |
edge-names | List | top, right, bottom, left components [1] |
child-names | List | child components [2] |
Notes:
-
[1] for example
margin
has edge-namestop-margin
…left-margin
-
[2] for example
font
has child-namesfamily-name
,font-weight
…