CSS::D...e::List(3pm)

πŸ“¦
version 0.17 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– CSS::DOM::Value::List β€” the CSSValueList glow-up πŸ’–

okay bestie, so this is the manual page for CSS::DOM::Value::List(3pm), from the User Contributed Perl Documentation collection, and it's lowkey the whole personality of CSS list values. sit with me, we're doing this together 🫢


✨ NAME ✨

CSS::DOM::Value::List β€” the CSSValueList class for CSS::DOM, and yes she ate πŸ’…


🌸 VERSION 🌸

Version 0.17. iconic, no notes.


πŸŽ€ SYNOPSIS πŸŽ€

  # ...

literally that's it, that's the whole synopsis, the author said "figure it out bestie" 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. this module implements objects that represent CSS list property values. like, the whole vibe of a list-y CSS value? that's her. she implements the DOM CSSValueList interface, so she speaks fluent DOM.

you can get at the individual elements of the list two ways:

  • using the item and length methods, or
  • just using it as an array ref ✨

pick your fighter, both are valid.


πŸ’… METHODS πŸ’…

if you need the constructor, bestie, it's chilling down below the object methods. normally you would get an object via CSS::DOM::Style's getPropertyCSSValue method. that's the normal girl route.

🌈 CSSValue Interface 🌈

  • cssText β€” returns a string representation of the attribute. pass an argument and it sets it instead. two jobs, one method, we love a multi-hyphenate πŸ‘‘
  • cssValueType β€” returns CSS::DOM::Value::CSS_PRIMITIVE_VALUE. that's it. that's the whole answer. periodt.

πŸ“ CSSValueList Interface πŸ“

  • item β€” returns the 'primitive' value at the given index. very "give me the one at position n" energy.
  • length β€” returns the number of values in the list. she's counting, she's keeping track, she's that girl.

🧚 Constructor 🧚

you probably don't need to call this, but here it is anyway, because we don't gatekeep:

  $val = new CSS::DOM::Value::List:: %args;

the hash-style arguments are as follows. only values is required β€” everything else is a little bonus ✨

  • values β€” this must be an array ref containing the individual values to be stored in the list. the individual elements can be value objects or array refs of arguments to pass to new CSS::DOM::Value::Primitive. E.g.,
  [
      [type => CSS_PX, value => 20],
      [type => CSS_PERCENTAGE, value => 50],
      [type => CSS_PERCENTAGE, value => 50],
      [type => CSS_PX, value => 50],
  ]
  • css β€” CSS code used for serialisation. this will make reading cssText faster, at least until the value is modified. so like, a lil speed boost that expires, we've all been there πŸ™ˆ
  • separator β€” the value separator used in serialisation. this is usually ' ' or ', '. an empty string or undef is treated as a space. so if you pass nothing, you get a space, she's got a default and she's sticking to it.
  • owner β€” the style object that owns this value; if this is omitted, then the value is read-only. and important detail: the value object holds a weak reference to the owner. noted, filed, remembered πŸ”₯
  • property β€” the name of the CSS property to which this value belongs. cssText uses this to determine how to parse text passed to it. this does not apply to the sub-values of colours, counters and rects, but it does apply to individual elements of a list value. very specific, very important, write it down bestie πŸ“

πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, they're all connected, it's a whole cinematic universe:

  • CSS::DOM
  • CSS::DOM::Value
  • CSS::DOM::Value::Primitive
  • CSS::DOM::Style

and that's the page, bestie πŸ’– this was CSS::DOM::Value::List, version 0.17, shipped under perl v5.36.0 and dated 2023-08-02 β€” a whole lil time capsule of list-value excellence. mwah, go write some CSS values, you're gonna slay πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from