-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
51 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
prototype(Carbon.Notification:Style) < prototype(Neos.Fusion:Component) { | ||
config = ${Configuration.setting('Carbon.Notification')} | ||
types = ${Array.filter(this.config.types, entry => !!entry)} | ||
|
||
@if.hasTypesAndInBackend = ${node.context.inBackend && Array.length(this.types)} | ||
|
||
renderer = Neos.Fusion:Join { | ||
// These styles are for all types | ||
generalSelectorList = Neos.Fusion:Loop { | ||
@glue = ',' | ||
items = ${props.types} | ||
itemRenderer = ${'[data-carbon-' + itemKey + ']::after'} | ||
} | ||
generalProperties = Neos.Fusion:Loop { | ||
@glue = ';' | ||
items = ${Array.filter(Array.concat(props.config.default, props.config.data.default), entry => !!entry)} | ||
itemRenderer = ${itemKey + ':' + item} | ||
@process.wrap = ${'{' + value + '}'} | ||
} | ||
|
||
// Set special property per type and add the text | ||
content = Neos.Fusion:Loop { | ||
items = ${props.types} | ||
itemKey = 'type' | ||
itemRenderer = Neos.Fusion:Join { | ||
selectorAndContent = ${'[data-carbon-' + type + ']::after{content:attr(data-carbon-' + type + ');'} | ||
properties = Neos.Fusion:Loop { | ||
@glue = ';' | ||
items = ${Array.filter(item, entry => !!entry)} | ||
itemRenderer = ${itemKey + ':' + item} | ||
} | ||
closeStyle = '}' | ||
} | ||
} | ||
|
||
// These styles are set if the HTML has some content | ||
notEmptySelectorList = Neos.Fusion:Loop { | ||
@glue = ',' | ||
items = ${props.types} | ||
itemRenderer = ${'[data-carbon-' + itemKey + ']:not(:empty)::after'} | ||
} | ||
notEmptyProperties = Neos.Fusion:Loop { | ||
@glue = ';' | ||
items = ${Array.filter(props.config.data.notEmpty, entry => !!entry)} | ||
itemRenderer = ${itemKey + ':' + item} | ||
@process.wrap = ${'{' + value + '}'} | ||
} | ||
@process.wrap = ${'<style type="text/css">' + value + '</style>'} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,3 @@ | ||
prototype(Neos.Neos:Page) { | ||
head.stylesheets.carbonNotification = Neos.Fusion:Component { | ||
config = ${Configuration.setting('Carbon.Notification')} | ||
types = ${Array.filter(this.config.types, entry => !!entry)} | ||
|
||
@if.hasTypesAndInBackend = ${node.context.inBackend && Array.length(this.types)} | ||
|
||
renderer = Neos.Fusion:Join { | ||
// These styles are for all types | ||
generalSelectorList = Neos.Fusion:Loop { | ||
@glue = ',' | ||
items = ${props.types} | ||
itemRenderer = ${'[data-carbon-' + itemKey + ']::after'} | ||
} | ||
generalProperties = Neos.Fusion:Loop { | ||
@glue = ';' | ||
items = ${Array.filter(Array.concat(props.config.default, props.config.data.default), entry => !!entry)} | ||
itemRenderer = ${itemKey + ':' + item} | ||
@process.wrap = ${'{' + value + '}'} | ||
} | ||
|
||
// Set special property per type and add the text | ||
content = Neos.Fusion:Loop { | ||
items = ${props.types} | ||
itemKey = 'type' | ||
itemRenderer = Neos.Fusion:Join { | ||
selectorAndContent = ${'[data-carbon-' + type + ']::after{content:attr(data-carbon-' + type + ');'} | ||
properties = Neos.Fusion:Loop { | ||
@glue = ';' | ||
items = ${Array.filter(item, entry => !!entry)} | ||
itemRenderer = ${itemKey + ':' + item} | ||
} | ||
closeStyle = '}' | ||
} | ||
} | ||
|
||
// These styles are set if the HTML has some content | ||
notEmptySelectorList = Neos.Fusion:Loop { | ||
@glue = ',' | ||
items = ${props.types} | ||
itemRenderer = ${'[data-carbon-' + itemKey + ']:not(:empty)::after'} | ||
} | ||
notEmptyProperties = Neos.Fusion:Loop { | ||
@glue = ';' | ||
items = ${Array.filter(props.config.data.notEmpty, entry => !!entry)} | ||
itemRenderer = ${itemKey + ':' + item} | ||
@process.wrap = ${'{' + value + '}'} | ||
} | ||
@process.wrap = ${'<style type="text/css">' + value + '</style>'} | ||
} | ||
} | ||
head.stylesheets.carbonNotification = Carbon.Notification:Style | ||
} | ||
|