foundation6.theme

Classes

BaseTheme

Base class for Zurb Foundation based themes. Use this class to

Theme

Zurb Foundation vanilla theme. Use this if you don't want any changes

Module Contents

class foundation6.theme.BaseTheme(compress: bool = True)[source]

Bases: onegov.core.theme.Theme

Base class for Zurb Foundation based themes. Use this class to create a theme that customizes Zurb Foundation somehow.

If you don’t want to customize it at all, use Theme.

To customize start like this:

from onegov.foundation import BaseTheme

class MyTheme(BaseTheme):
    name = 'my-theme'
    version = '1.0'

You can then add paths with your own scss files, as well as imports that should be added before the foundation theme, and imports that should be added after the foundation theme.

Finally, options passed to the compile() function take this form:

options = {
    'rowWidth': '1000px',
    'columnGutter': '30px'
}

Those options result in variables added at the very top of the sass source (but after the _settings.scss) before it is compiled:

$rowWidth: 1000px;
$columnGutter: 30px;

If your variables rely on a certain order you need to pass an ordered dict.

If use_flex is set to False on the theme itself, the float grid is used instead.

If $xy-grid is set to false by the subclassing theme, the flex grid is used.

_uninitialized_vars = ('primary-color', 'secondary-color', 'success-color', 'warning-color', 'alert-color',...[source]
include_motion_ui = False[source]
property default_options: dict[str, Any][source]

Default options used when compiling the theme.

property pre_imports: list[str][source]

Imports added before the foundation import. The imports must be found in one of the paths (see extra_search_paths).

The form of a single import is ‘example’ (which would search for files named ‘example.scss’)

use_prototype = False[source]
use_flex = False[source]
property foundation_helpers: str[source]
property foundation_config_vars: Sequence[str][source]
property foundation_grid: str[source]

Defines the settings that are grid related as in the mixin foundation_everything.

property foundation_styles: Sequence[str][source]

The default styles

property foundation_components: tuple[str, Ellipsis][source]

Foundation components except the grid without the prefix as in app.scss that will be included. Be aware that order matters. These are included, not imported.

property foundation_motion_ui: Sequence[str][source]
property post_imports: list[str][source]

Imports added after the foundation import. The imports must be found in one of the paths (see extra_search_paths).

The form of a single import is ‘example’ (which would search for files named ‘example.scss’)

property extra_search_paths: list[str][source]

A list of absolute search paths added before the actual foundation search path.

property foundation_path: str[source]

The search path for the foundation files included in this module.

property vendor_path: str[source]

The search path for the foundation files included in this module.

property includes: Iterator[str][source]
compile(options: Mapping[str, Any] | None = None) str[source]

Compiles the theme with the given options.

class foundation6.theme.Theme(compress: bool = True)[source]

Bases: BaseTheme

Zurb Foundation vanilla theme. Use this if you don’t want any changes to zurb foundation, except for setting supported variables.

Do not use this class as a base for your own theme!

Example:

from onegov.core import Framework
from onegov.foundation import Theme

class App(FoundationApp):
    theme_options = {
        'rowWidth': '1200px'
    }

@App.setting(section='core', name='theme')
def get_theme():
    return Theme()
name = 'zurb.foundation'[source]