foundation6.theme ================= .. py:module:: foundation6.theme Classes ------- .. autoapisummary:: foundation6.theme.BaseTheme foundation6.theme.Theme Module Contents --------------- .. py:class:: BaseTheme(compress: bool = True) Bases: :py:obj:`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 :class:`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 :meth:`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. .. py:attribute:: _uninitialized_vars :value: ('primary-color', 'secondary-color', 'success-color', 'warning-color', 'alert-color',... .. py:attribute:: include_motion_ui :value: False .. py:attribute:: compress :value: True .. py:property:: default_options :type: dict[str, Any] Default options used when compiling the theme. .. py:property:: pre_imports :type: list[str] Imports added before the foundation import. The imports must be found in one of the paths (see :attr:`extra_search_paths`). The form of a single import is 'example' (which would search for files named 'example.scss') .. py:attribute:: use_prototype :value: False .. py:attribute:: use_flex :value: False .. py:property:: foundation_helpers :type: str .. py:property:: foundation_config_vars :type: collections.abc.Sequence[str] .. py:property:: foundation_grid :type: str Defines the settings that are grid related as in the mixin foundation_everything. .. py:property:: foundation_styles :type: collections.abc.Sequence[str] The default styles .. py:property:: foundation_components :type: tuple[str, Ellipsis] 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. .. py:property:: foundation_motion_ui :type: collections.abc.Sequence[str] .. py:property:: post_imports :type: list[str] Imports added after the foundation import. The imports must be found in one of the paths (see :attr:`extra_search_paths`). The form of a single import is 'example' (which would search for files named 'example.scss') .. py:property:: extra_search_paths :type: list[str] A list of absolute search paths added before the actual foundation search path. .. py:property:: foundation_path :type: str The search path for the foundation files included in this module. .. py:property:: vendor_path :type: str The search path for the foundation files included in this module. .. py:property:: includes :type: collections.abc.Iterator[str] .. py:method:: compile(options: collections.abc.Mapping[str, Any] | None = None) -> str Compiles the theme with the given options. .. py:class:: Theme(compress: bool = True) Bases: :py:obj:`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() .. py:attribute:: name :value: 'zurb.foundation' The name of the theme, must be unique.