Skip to content

Commit a4be956

Browse files
authored
Update README.md
1 parent daa977d commit a4be956

File tree

1 file changed

+28
-33
lines changed

1 file changed

+28
-33
lines changed

README.md

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,34 @@ provides an interface for fluent color transformations.
77
```
88
prototype(Vendor.Site:CustomCssProperties) < prototype(Neos.Fusion:Component) {
99
10-
renderer = Neos.Fusion:Tag
11-
tagName = 'style'
12-
content = Neos.Fusion:Join {
13-
14-
//
15-
// based on the properties `font` and `bgColor` some
16-
// costom properties are prepared globally
17-
//
18-
19-
base = PackageFactory.ColorHelper:CssVariables {
20-
values = Neos.Fusion:DataStructure {
21-
font = ${q(site).property('font')}
22-
bg = ${q(site).property('bgColor')}
23-
bg-lighter = ${Color.css(this.bg).lighten(20)}
24-
bg-transparent = ${Color.css(this.bg).fadeout(20)}
25-
}
26-
}
27-
28-
//
29-
// based on the properties `bgColorMobile` additional css
30-
// properties are defined that will be rendered in mobile
31-
// breakpoints and override the other values
32-
//
33-
34-
mobile = PackageFactory.ColorHelper:CssVariables {
35-
mediaQuery = 'screen and (max-width: 600px)'
36-
values = Neos.Fusion:DataStructure {
37-
bg = ${q(site).property('bgColorMobile')}
38-
bg-lighter = ${Color.css(this.bg).lighten(20)}
39-
bg-transparent = ${Color.css(this.bg).fadeout(20)}
40-
}
41-
}
42-
}
10+
//
11+
// based on the size-properties `font` and `bgColor` some
12+
// values shall be set globally
13+
//
14+
base = Neos.Fusion:DataStructure {
15+
font = ${q(site).property('font')}
16+
bg = ${q(site).property('bgColor')}
17+
bg-lighter = ${Color.css(this.bg).lighten(20)}
18+
bg-transparent = ${Color.css(this.bg).fadeout(20)}
19+
}
20+
21+
//
22+
// based on the properties `bgColorMobile` additional css
23+
// properties are defined that will be rendered in mobile
24+
// breakpoints and override the other values
25+
//
26+
mobileQuery = 'screen and (max-width: 600px)'
27+
mobile = Neos.Fusion:DataStructure {
28+
bg = ${q(site).property('bgColorMobile')}
29+
bg-lighter = ${Color.css(this.bg).lighten(20)}
30+
bg-transparent = ${Color.css(this.bg).fadeout(20)}
31+
}
32+
33+
renderer = afx`
34+
<style>
35+
<PackageFactory.ColorHelper:CssVariables value={props.base} />
36+
<PackageFactory.ColorHelper:CssVariables value={props.mobile} mediaQuery={props.mobileQuery} />
37+
</style>
4338
`
4439
}
4540
```

0 commit comments

Comments
 (0)