REBOL Document

Stylize - Function Summary


Summary:

Return a style sheet block.

Usage:

stylize specs

Arguments:

specs - A block of: new-style: old-style facets (must be: block)

Refinements:

/master - Add to or change master style sheet

/styles - The styles refinement.

styls - Base on existing style sheet (must be: block)

Description:

This function allows you to define a set of face styles that can be used in multiple layouts. For instance, if you want to define a standard style of text or a standard button style, you can place it in a stylesheet using STYLIZE. The stylesheet can then be used in one or more layouts.

Each style is specified in a format that is similar to LAYOUT. The STYLIZE function returns a stylesheet block that can be used in a layout.

The code below defines a stylesheet that contains three styles:


    text-styles: stylize [
        big-text: text font-size 50
        red-text: text red
        bold-blue-text: text bold blue font-size 50
    ]


    view layout [
        styles text-styles
        big-text "One big heading..."
        red-text "This text will appear red."
        bold-blue-text "This is big, bold, and blue."
    ]

Multiple stylesheets can be used in a layout.

The stylize function also allows you to modify the master styles for your current REBOL session. However, be careful, as all scripts that are run after modifying the master stylesheet will be affected.

Related:

layout - Return a face with a pane built from style description dialect.


<Back | Index | Next>

Copyright 2004 REBOL Technologies