|
Class: CSS_StyleElement (in HTML)
Object
|
+--HTML::CSS_AbstractStyleObject
|
+--HTML::CSS_StyleElement
- Package:
- stx:goodies/webServer/htmlTree
- Category:
- Net-Documents-HTML-StyleSheet
- Version:
- rev:
1.9
date: 2018/04/26 10:34:16
- user: cg
- file: HTML__CSS_StyleElement.st directory: goodies/webServer/htmlTree
- module: stx stc-classLibrary: htmlTree
instance creation
-
selectors: aSelectorCollection
-
Create a new style element with its selectors.
The properties keep empty here. Though an empty
style elment is not useful, we allow to build it,
because properties can be added via interface easily.
A style element can have one or a list of selectors.
See instance method: '#selectors:properties:'.
-
selectors: aSelectorCollection properties: aPropertyCollection
-
Create a new style element with its selectors and properties.
The selectors are the names under which the style will be
accessible. There must be minimum one selector.
The properties are the definitions forming the style.
A property collection may be nil here to define an empty style.
Though an empty style elment is not useful, we allow to build
it, because properties can be added via interface easily.
The properties have to be ready build properties.
accessing
-
properties
-
Return the properties.
The properties are the definitions
of the show the style looks like.
-
selectors
-
Return the Selectors.
The selectors are the names under
which the style is accessible.
interface-accessing
-
backgroudColorAqua
-
Set backgroudColor in properties to be aqua.
-
backgroudColorBlack
-
Set backgroudColor in properties to be black.
-
backgroudColorBlue
-
Set backgroudColor in properties to be blue.
-
backgroudColorFuchsia
-
Set color in properties to be fuchsia.
-
backgroudColorGray
-
Set color in properties to be gray.
-
backgroudColorGreen
-
Set color in properties to be green.
-
backgroudColorLime
-
Set color in properties to be lime.
-
backgroudColorMaroon
-
Set color in properties to be maroon.
-
backgroudColorNavy
-
Set color in properties to be navy.
-
backgroudColorOlive
-
Set color in properties to be olive.
-
backgroudColorPurple
-
Set color in properties to be purple.
-
backgroudColorRed
-
Set color in properties to be red.
-
backgroudColorSilver
-
Set color in properties to be silver.
-
backgroudColorTeal
-
Set color in properties to be teal.
-
backgroudColorWhite
-
Set color in properties to be white.
-
backgroudColorYellow
-
Set color in properties to be white.
-
backgroundAttachment: aValue
-
Add a background-attachment to the properties.
-
backgroundColor: aValue
-
Add a background-color to the properties.
-
backgroundImage: aValue
-
Add a background-image to the properties.
-
backgroundPosition: aValue
-
Add a background-position to the properties.
-
backgroundRepeat: aValue
-
Add a background-repeat to the properties.
-
color: aValue
-
Add a color to the properties.
-
colorAqua
-
Set color in properties to be aqua.
-
colorBlack
-
Set color in properties to be black.
-
colorBlue
-
Set color in properties to be blue.
-
colorFuchsia
-
Set color in properties to be fuchsia.
-
colorGray
-
Set color in properties to be gray.
-
colorGreen
-
Set color in properties to be green.
-
colorLime
-
Set color in properties to be lime.
-
colorMaroon
-
Set color in properties to be maroon.
-
colorNavy
-
Set color in properties to be navy.
-
colorOlive
-
Set color in properties to be olive.
-
colorPurple
-
Set color in properties to be purple.
-
colorRed
-
Set color in properties to be red.
-
colorSilver
-
Set color in properties to be silver.
-
colorTeal
-
Set color in properties to be teal.
-
colorWhite
-
Set color in properties to be white.
-
colorYellow
-
Set color in properties to be yellow.
private-accessing
-
buildSelectors: aRawSelectors
-
Build the selectors from a raw object with the selector information.
This could be a string for one selector or a collection of selectors.
-
selectors: aSelectorCollection properties: aPropertyCollection
-
Set selectors and properties.
Private - Use only for instance creation.
private-building
-
addProperty: aProperty
-
Add a new property of a class.
-
addProperty: aClass value: aValue
-
Build and add a new property of a class.
visiting
-
acceptHTMLVisitor: aVisitor
-
visitor pattern: dispatch me to the visitor
Create an empty style element with one selector:
|element|
element := StyleElement selectors:#H1.
element htmlString.
|
Create an empty style element with a list of selectors:
|element|
element := StyleElement selectors:#('H1' 'H2' 'H3').
element htmlString.
|
Create an empty style and add some properties
|element|
element := StyleElement selectors:#H1.
element color:#red.
element backgroundColor:#black.
element htmlString.
|
Create a style element from predefined properties:
|properties element|
properties := Array with: (CSS_Color with:#red)
with: (BackgroundColor with:#black).
element := StyleElement
selectors: #H1
properties:properties.
element htmlString.
|
|