View on GitHub

CSS-Properties-raku

CSS property-list manipulation library

[Raku CSS Project] / [CSS-Properties Module] / CSS::Properties :: Property

class CSS::Properties::Property

Meta-data for a given property

Synopsis

use CSS::Properties::Property;
my CSS::Properties::Property %edges = <top right bottom left>.map: {
    $_ => CSS::Properties::Property.new: :name('margin-' ~ $_);
}
my CSS::Properties::Property $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::Property :%edges{ :$top, :$left, :$bottom, :$right},
 ) returns CSS::Properties::Property;

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: