eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HTML::CSS_StyleElement':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: CSS_StyleElement (in HTML)


Inheritance:

   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

Class protocol:

instance creation
o  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:'.

o  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.


Instance protocol:

accessing
o  properties
Return the properties.
The properties are the definitions
of the show the style looks like.

o  selectors
Return the Selectors.
The selectors are the names under
which the style is accessible.

interface-accessing
o  backgroudColorAqua
Set backgroudColor in properties to be aqua.

o  backgroudColorBlack
Set backgroudColor in properties to be black.

o  backgroudColorBlue
Set backgroudColor in properties to be blue.

o  backgroudColorFuchsia
Set color in properties to be fuchsia.

o  backgroudColorGray
Set color in properties to be gray.

o  backgroudColorGreen
Set color in properties to be green.

o  backgroudColorLime
Set color in properties to be lime.

o  backgroudColorMaroon
Set color in properties to be maroon.

o  backgroudColorNavy
Set color in properties to be navy.

o  backgroudColorOlive
Set color in properties to be olive.

o  backgroudColorPurple
Set color in properties to be purple.

o  backgroudColorRed
Set color in properties to be red.

o  backgroudColorSilver
Set color in properties to be silver.

o  backgroudColorTeal
Set color in properties to be teal.

o  backgroudColorWhite
Set color in properties to be white.

o  backgroudColorYellow
Set color in properties to be white.

o  backgroundAttachment: aValue
Add a background-attachment to the properties.

o  backgroundColor: aValue
Add a background-color to the properties.

o  backgroundImage: aValue
Add a background-image to the properties.

o  backgroundPosition: aValue
Add a background-position to the properties.

o  backgroundRepeat: aValue
Add a background-repeat to the properties.

o  color: aValue
Add a color to the properties.

o  colorAqua
Set color in properties to be aqua.

o  colorBlack
Set color in properties to be black.

o  colorBlue
Set color in properties to be blue.

o  colorFuchsia
Set color in properties to be fuchsia.

o  colorGray
Set color in properties to be gray.

o  colorGreen
Set color in properties to be green.

o  colorLime
Set color in properties to be lime.

o  colorMaroon
Set color in properties to be maroon.

o  colorNavy
Set color in properties to be navy.

o  colorOlive
Set color in properties to be olive.

o  colorPurple
Set color in properties to be purple.

o  colorRed
Set color in properties to be red.

o  colorSilver
Set color in properties to be silver.

o  colorTeal
Set color in properties to be teal.

o  colorWhite
Set color in properties to be white.

o  colorYellow
Set color in properties to be yellow.

private-accessing
o  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.

o  selectors: aSelectorCollection properties: aPropertyCollection
Set selectors and properties.
Private - Use only for instance creation.

private-building
o  addProperty: aProperty
Add a new property of a class.

o  addProperty: aClass value: aValue
Build and add a new property of a class.

visiting
o  acceptHTMLVisitor: aVisitor
visitor pattern: dispatch me to the visitor


Examples:


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.


ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 19 Mar 2024 11:33:12 GMT