SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
A DSL enabling programmatic
cascading style sheet generation
+
google.com/+GabrielCotelli
Project
Goals
● Improve CSS integration with existing Web Frameworks
● Write & refactor in Smalltalk, deploy to CSS
Highlights
● Source code is MIT licensed
● Documentation is CC BY-SA 4.0 licensed
● The project is managed in GitHub
● Supports Pharo 3 , 4 and 5
● Follows semantic versioning rules
Basic Example
div
{
margin: 2px;
background-color: aliceblue;
}
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | selector div ]
with: [:style |
style
margin: 2 px;
backgroundColor: CssSVGColors aliceBlue];
build
CSS properties are defined in the API by the following rules:
● Properties without dashes are directly mapped: margin becomes a margin: message send.
● Properties with dashes are converted to Camel Case: margin-top becomes marginTop:
Simple Property Values
● Plain integers, floats or strings can be used as values.
● Several properties have keyword constants as values. This support is
provided by CssConstants and CssFontConstants:
CssConstants justify
● Other properties required measures as values. The library provides units
for length, time, angles and frequencies:
2 px. 5 em. 90 deg.
● Colors, are also supported. Well known ones can be accessed by
CssSVGColors. RGB and HSL colors are also supported including the alpha
channel specification:
CssSVGColors aliceBlue.
CssRGBColor red: 0 green: 128 blue: 0 alpha: 0.5.
Multi-valued properties
Some properties support a wide range of values. A prototypical example is the
margin property supporting 1, 2, 3 or 4 values. In this cases to provide more
than one value use an Array.
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | selector div ]
with: [:style | style margin: { 2 px. 4 px } ];
build
div
{
margin: 2px 4px;
}
Complex Property Values
● Gradients and Box Shadows
div
{
background: linear-gradient(45deg, yellow, blue);
}
span
{
background: radial-gradient(yellow, green);
}
● Functional Notation: calc(), attr() and toggle() are also supported
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | selector div ]
with: [:style | style background: (CssLinearGradient rotated: 45 deg fading: { CssSVGColors yellow. CssSVGColors blue }) ];
declareRuleSetFor: [:selector | selector span]
with: [:style | style background: (CssRadialGradient fading: { CssSVGColors yellow. CssSVGColors green }) ];
build
Selectors
Selectors represents a structure used to match elements in the document
tree. One of the most common selectors is the type one, matching a specific
element type in the DOM.
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | selector orderedList ]
with: [:style | … ];
build
ol
{ … }
To get a list of the supported type selectors inspect:
CssSelector selectorsInProtocol: '*RenoirSt-HTML'
Combinators
Are used to combine other selectors.
Descendant selector div orderedList div ol
selector div * selector orderedList div * ol
Child selector div > selector orderedList div > ol
Adjacent Sibling selector div + selector orderedList div + ol
General Sibling selector div ~ selector orderedList div ~ ol
Class and Id Selectors
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector |
(selector div class: BootstrapCssStyles row) id: #account5 ]
with: [:style | … ];
build
div.row#account5
{
…
}
Attribute Selectors
Are useful to match an element using the related attributes information.
Presence selector havingAttribute: 'title' [title]
Exact value selector withAttribute: 'class' equalTo: 'example' [class="example"]
Value inclusion selector attribute: 'rel' includes: 'copyright' [rel~="copyright"]
selector firstValueOfAttribute: 'hreflang' beginsWith: 'en' [hreflang|="en"]
Substring matching selector attribute: 'type' beginsWith:image'
selector attribute: 'type' endsWith: '.html'
selector attribute: 'title' includesSubstring: 'hello'
[type^="image/"]
[type$=".html"]
[title*="hello"]
Pseudo-Class selectors
Allows selection based on information that lies outside the document tree.
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | selector anchor visited active]
with: [:style | … ];
build
a:visited:active
{
…
}
Structural Pseudo-Classes
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | selector childAt: 3 n + 1 ]
with: [:style | … ];
build
:nth-child(3n+1)
{
…
}
Additional Selectors
● Language Pseudo-Class :lang()
● Negation Pseudo-Class :not()
● Pseudo-Elements ::first-line ::first-letter ::before ::after
● Selector Groups:
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | (selector div class: 'note') after ,
(selector paragraph class: 'note') before ]
with: [:style | … ];
build
div.note::after ,
p.note::before
{ … }
Important Rules
CascadingStyleSheetBuilder new
declareRuleSetFor: [:selector | selector paragraph ]
with: [:style |
style beImportantDuring: [:importantStyle | importantStyle textIndent: 1 em ].
style fontSize: 18 pt.
];
build
p
{
text-indent: 1em !important;
font-size: 18pt;
}
Media Queries
A @media rule specifies the target media types of a set of statements.
CascadingStyleSheetBuilder new
declare: [ :cssBuilder |
cssBuilder
declareRuleSetFor: [ :selector | selector id: #oop ]
with: [ :style | style color: CssSVGColors red ]
]
forMediaMatching: [ :queryBuilder | queryBuilder type: CssMediaQueryConstants print ];
build
Additional stuff
● Font Face Rules
● Vendor Specific Properties
● ZnUrl and WAUrl extensions
● Deployment and Development Groups
Seaside Extension Examples
CssDeclarationBlock can be passed as an argument when a JSObject is
required:
renderOn: aCanvas
…
aCanvas
highcharts legend
itemStyle: (CssDeclarationBlock new fontSize: 11 px; yourself).
…
Seaside Extension Examples
CssDeclarationBlock can be used to inline css using “style” attributes:
renderCompanyNameIn: color on: aCanvas
…
aCanvas div
style: (
CssDeclarationBlock new
backgroundColor: color;
yourself)
…
That’s all folks!
Any question?
Source Code and Issues:
github.com/gcotelli/RenoirSt
Docs:
- Online tutorial in GitHub
- Pharo for Enterprise Book
Q&A:
RenoirSt Community

Weitere ähnliche Inhalte

Was ist angesagt? (6)

Css
CssCss
Css
 
CSS for basic learner
CSS for basic learnerCSS for basic learner
CSS for basic learner
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
20131108 cs query by howard
20131108 cs query by howard20131108 cs query by howard
20131108 cs query by howard
 
jQuery Beginner
jQuery BeginnerjQuery Beginner
jQuery Beginner
 
Cordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced JavascriptCordova training : Day 4 - Advanced Javascript
Cordova training : Day 4 - Advanced Javascript
 

Andere mochten auch

Ahmed Shaheen Ibrahim
Ahmed Shaheen IbrahimAhmed Shaheen Ibrahim
Ahmed Shaheen Ibrahim
Ahmed Shaheen
 
Poftabuna.ro se lanseaza
Poftabuna.ro se lanseazaPoftabuna.ro se lanseaza
Poftabuna.ro se lanseaza
sorovidin
 
Power%20point%202010 jpn
Power%20point%202010 jpnPower%20point%202010 jpn
Power%20point%202010 jpn
diegobicep
 
Syed Ghouse Resume 1
Syed Ghouse Resume 1Syed Ghouse Resume 1
Syed Ghouse Resume 1
Gouse Sayed
 
Century College Magazine (1)
Century College Magazine (1)Century College Magazine (1)
Century College Magazine (1)
Tenzin Gakyi
 

Andere mochten auch (13)

Ahmed Shaheen Ibrahim
Ahmed Shaheen IbrahimAhmed Shaheen Ibrahim
Ahmed Shaheen Ibrahim
 
App from Fluor and Shell project
App from Fluor  and Shell project App from Fluor  and Shell project
App from Fluor and Shell project
 
с днем рождения прокопьевск!
с днем рождения прокопьевск!с днем рождения прокопьевск!
с днем рождения прокопьевск!
 
Poftabuna.ro se lanseaza
Poftabuna.ro se lanseazaPoftabuna.ro se lanseaza
Poftabuna.ro se lanseaza
 
Level 5 Leadership in Health and Social Care
Level 5 Leadership in Health and Social CareLevel 5 Leadership in Health and Social Care
Level 5 Leadership in Health and Social Care
 
2016FallGrapevineFINAL.compressed
2016FallGrapevineFINAL.compressed2016FallGrapevineFINAL.compressed
2016FallGrapevineFINAL.compressed
 
Oppcnlgfhndgfhdgf
OppcnlgfhndgfhdgfOppcnlgfhndgfhdgf
Oppcnlgfhndgfhdgf
 
Power%20point%202010 jpn
Power%20point%202010 jpnPower%20point%202010 jpn
Power%20point%202010 jpn
 
Level 5 Leadership for Health Social Care
Level 5  Leadership for Health Social Care Level 5  Leadership for Health Social Care
Level 5 Leadership for Health Social Care
 
Syed Ghouse Resume 1
Syed Ghouse Resume 1Syed Ghouse Resume 1
Syed Ghouse Resume 1
 
Century College Magazine (1)
Century College Magazine (1)Century College Magazine (1)
Century College Magazine (1)
 
IT Architectures for Handling Big Data in Official Statistics: the Case of Sc...
IT Architectures for Handling Big Data in Official Statistics: the Case of Sc...IT Architectures for Handling Big Data in Official Statistics: the Case of Sc...
IT Architectures for Handling Big Data in Official Statistics: the Case of Sc...
 
Gestion cultural 2.0 introducción
Gestion cultural 2.0 introducciónGestion cultural 2.0 introducción
Gestion cultural 2.0 introducción
 

Ähnlich wie RenoirSt - A DSL enabling programmatic cascading style sheet generation

TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS Guide
Rohan Chandane
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
Tesfaye Yenealem
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
tsengsite
 

Ähnlich wie RenoirSt - A DSL enabling programmatic cascading style sheet generation (20)

TIBCO General Interface - CSS Guide
TIBCO General Interface - CSS GuideTIBCO General Interface - CSS Guide
TIBCO General Interface - CSS Guide
 
Chapter 4a cascade style sheet css
Chapter 4a cascade style sheet cssChapter 4a cascade style sheet css
Chapter 4a cascade style sheet css
 
Html advance
Html advanceHtml advance
Html advance
 
HTML-Advance.pptx
HTML-Advance.pptxHTML-Advance.pptx
HTML-Advance.pptx
 
Pfnp slides
Pfnp slidesPfnp slides
Pfnp slides
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Fewd week2 slides
Fewd week2 slidesFewd week2 slides
Fewd week2 slides
 
Css.html
Css.htmlCss.html
Css.html
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
css v1 guru
css v1 gurucss v1 guru
css v1 guru
 
An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)An Introduction to Cascading Style Sheets (CSS3)
An Introduction to Cascading Style Sheets (CSS3)
 
Css3
Css3Css3
Css3
 
Css
CssCss
Css
 
D3 data visualization
D3 data visualizationD3 data visualization
D3 data visualization
 
CSS Overview
CSS OverviewCSS Overview
CSS Overview
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 
CSS.pdf
CSS.pdfCSS.pdf
CSS.pdf
 
CSS
CSS CSS
CSS
 
CSS- Smacss Design Rule
CSS- Smacss Design RuleCSS- Smacss Design Rule
CSS- Smacss Design Rule
 

Kürzlich hochgeladen

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Kürzlich hochgeladen (20)

Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 

RenoirSt - A DSL enabling programmatic cascading style sheet generation

  • 1. A DSL enabling programmatic cascading style sheet generation + google.com/+GabrielCotelli
  • 2. Project Goals ● Improve CSS integration with existing Web Frameworks ● Write & refactor in Smalltalk, deploy to CSS Highlights ● Source code is MIT licensed ● Documentation is CC BY-SA 4.0 licensed ● The project is managed in GitHub ● Supports Pharo 3 , 4 and 5 ● Follows semantic versioning rules
  • 3. Basic Example div { margin: 2px; background-color: aliceblue; } CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | selector div ] with: [:style | style margin: 2 px; backgroundColor: CssSVGColors aliceBlue]; build CSS properties are defined in the API by the following rules: ● Properties without dashes are directly mapped: margin becomes a margin: message send. ● Properties with dashes are converted to Camel Case: margin-top becomes marginTop:
  • 4. Simple Property Values ● Plain integers, floats or strings can be used as values. ● Several properties have keyword constants as values. This support is provided by CssConstants and CssFontConstants: CssConstants justify ● Other properties required measures as values. The library provides units for length, time, angles and frequencies: 2 px. 5 em. 90 deg. ● Colors, are also supported. Well known ones can be accessed by CssSVGColors. RGB and HSL colors are also supported including the alpha channel specification: CssSVGColors aliceBlue. CssRGBColor red: 0 green: 128 blue: 0 alpha: 0.5.
  • 5. Multi-valued properties Some properties support a wide range of values. A prototypical example is the margin property supporting 1, 2, 3 or 4 values. In this cases to provide more than one value use an Array. CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | selector div ] with: [:style | style margin: { 2 px. 4 px } ]; build div { margin: 2px 4px; }
  • 6. Complex Property Values ● Gradients and Box Shadows div { background: linear-gradient(45deg, yellow, blue); } span { background: radial-gradient(yellow, green); } ● Functional Notation: calc(), attr() and toggle() are also supported CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | selector div ] with: [:style | style background: (CssLinearGradient rotated: 45 deg fading: { CssSVGColors yellow. CssSVGColors blue }) ]; declareRuleSetFor: [:selector | selector span] with: [:style | style background: (CssRadialGradient fading: { CssSVGColors yellow. CssSVGColors green }) ]; build
  • 7. Selectors Selectors represents a structure used to match elements in the document tree. One of the most common selectors is the type one, matching a specific element type in the DOM. CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | selector orderedList ] with: [:style | … ]; build ol { … } To get a list of the supported type selectors inspect: CssSelector selectorsInProtocol: '*RenoirSt-HTML'
  • 8. Combinators Are used to combine other selectors. Descendant selector div orderedList div ol selector div * selector orderedList div * ol Child selector div > selector orderedList div > ol Adjacent Sibling selector div + selector orderedList div + ol General Sibling selector div ~ selector orderedList div ~ ol
  • 9. Class and Id Selectors CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | (selector div class: BootstrapCssStyles row) id: #account5 ] with: [:style | … ]; build div.row#account5 { … }
  • 10. Attribute Selectors Are useful to match an element using the related attributes information. Presence selector havingAttribute: 'title' [title] Exact value selector withAttribute: 'class' equalTo: 'example' [class="example"] Value inclusion selector attribute: 'rel' includes: 'copyright' [rel~="copyright"] selector firstValueOfAttribute: 'hreflang' beginsWith: 'en' [hreflang|="en"] Substring matching selector attribute: 'type' beginsWith:image' selector attribute: 'type' endsWith: '.html' selector attribute: 'title' includesSubstring: 'hello' [type^="image/"] [type$=".html"] [title*="hello"]
  • 11. Pseudo-Class selectors Allows selection based on information that lies outside the document tree. CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | selector anchor visited active] with: [:style | … ]; build a:visited:active { … }
  • 12. Structural Pseudo-Classes CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | selector childAt: 3 n + 1 ] with: [:style | … ]; build :nth-child(3n+1) { … }
  • 13. Additional Selectors ● Language Pseudo-Class :lang() ● Negation Pseudo-Class :not() ● Pseudo-Elements ::first-line ::first-letter ::before ::after ● Selector Groups: CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | (selector div class: 'note') after , (selector paragraph class: 'note') before ] with: [:style | … ]; build div.note::after , p.note::before { … }
  • 14. Important Rules CascadingStyleSheetBuilder new declareRuleSetFor: [:selector | selector paragraph ] with: [:style | style beImportantDuring: [:importantStyle | importantStyle textIndent: 1 em ]. style fontSize: 18 pt. ]; build p { text-indent: 1em !important; font-size: 18pt; }
  • 15. Media Queries A @media rule specifies the target media types of a set of statements. CascadingStyleSheetBuilder new declare: [ :cssBuilder | cssBuilder declareRuleSetFor: [ :selector | selector id: #oop ] with: [ :style | style color: CssSVGColors red ] ] forMediaMatching: [ :queryBuilder | queryBuilder type: CssMediaQueryConstants print ]; build
  • 16. Additional stuff ● Font Face Rules ● Vendor Specific Properties ● ZnUrl and WAUrl extensions ● Deployment and Development Groups
  • 17. Seaside Extension Examples CssDeclarationBlock can be passed as an argument when a JSObject is required: renderOn: aCanvas … aCanvas highcharts legend itemStyle: (CssDeclarationBlock new fontSize: 11 px; yourself). …
  • 18. Seaside Extension Examples CssDeclarationBlock can be used to inline css using “style” attributes: renderCompanyNameIn: color on: aCanvas … aCanvas div style: ( CssDeclarationBlock new backgroundColor: color; yourself) …
  • 19. That’s all folks! Any question? Source Code and Issues: github.com/gcotelli/RenoirSt Docs: - Online tutorial in GitHub - Pharo for Enterprise Book Q&A: RenoirSt Community