Skip to content

InlineStyle Service and InlineStyle Workers

Nicolas Peltier edited this page Sep 28, 2020 · 1 revision

Inline Style service

that service is an implementation of Abstract Worker Manager and allows one component to get inline style that would be contextual to its usage. You should really consider using classes first, and leave styling to CSS, but in case of combinatory explosion of styling possibilities, this allows you clean management of a <style> tag next to your component.

Concept

will look at component's specific CA Config for worker sequence, and if those workers are registered they will be executed twice:

  • once to get specific css declarations specific to the actual breakpoint (e.g. color: white;),
  • once to get specific css rules specific to a breakpoint (e.g. p { color: white;})

Available Workers

Background

sets background-image, background-site, background-position, background-color rules (see unit test for all details around usage)

Border

sets border and border-radius rules (see unit test for all details around usage)

Color

sets color rule (see unit test for usage)

Shadow

sets box-shadow rule (see unit test for usage)