Skip to main content

Customization

Customizing the theme

How to customize the theme – e.g. colors, fonts, font sizes, header or footer – and how to add your own CSS is explained in the section Customizing the styling.

By default all pages under Modules, Layouts and Elements are configured so that they are neither indexed by search engines nor appear in the results of the Contao search. You can change this per page at any time – with the fields Robots tag (under Meta data) and Do not search (under Search settings).


JavaScript customization

For your own JavaScript, it is best to create a separate file and include it in the page layout. This keeps updates of the original theme easy and your customizations cleanly separated.


Placing elements with your own insert tag

The page “Nature Theme Elemente” contains articles that you can include anywhere on your website with an insert tag. You find these articles by clicking Articles in the left menu and scrolling all the way down.

In the article settings of the article (via the wrench icon), select the matching Theme Helper Tag under Template settings. The field Page name lets you select a specific page – this is only necessary in a multi-domain installation.

You can then place the article with the following insert tag, e.g. in an HTML element or a template: e.g. {{theme::content::NATURE01/01}}.

How to define your own Theme Helper Tags is explained in the Theme Helper documentation.


Layouts

Under Themes → Page layouts there are four preconfigured layouts that you can assign to a page in the page settings under Layout settings:

  • One-column layout
  • Two-column layout with right column
  • Two-column layout with left column
  • Three-column layout

There are also special layouts in which the logo and navigation are stacked. This feature is available from NATURE theme version 1.7.0. To activate it, simply add the body class header-block-layout.


You can edit the logo in the article “01_Logo”, which you find under Nature Theme Elemente → 01_Header.

You edit the footer content in the articles under Nature Theme Elemente → 02_Footer.

The article “01_Logo” contains two logos: one for the light color scheme and one for the dark color scheme (dark mode). The second logo element gets the CSS class logo-light so that it is displayed correctly depending on the chosen color scheme or in dark mode.


Customizing the styling

After installing the theme, you find the SCSS files in the file manager under the path naturetheme/scss.

Depending on the installed theme version, there are two ways to make your own customizations:

Older theme versions: You use the files

  • custom.scss (for SCSS and CSS)
  • _custom_colors.scss (to change the base colors and choose a color scheme)
  • _custom_variables.scss (for more detailed adjustments such as fonts or colors of individual elements)

To change a variable, remove the comment characters (slashes) in front of the line in the respective file.

Newer theme versions: As of the latest version there are no SCSS variables anymore, only CSS variables. In addition, _custom_colors.scss was merged into _custom_variables.scss – so you only find one file named _custom_variables.scss. There you can adjust all color and other variables. Here, too, you have to uncomment the lines to activate changes.

In both cases you can still add your own SCSS or CSS in custom.scss.

Tip

If the SCSS file was not edited with the Contao editor but uploaded with an FTP program, you have to purge the script cache under System maintenance in the Contao back end and, if necessary, reload the page with Ctrl + F5.

Note

Do not rename the theme folder naturetheme in the file manager, otherwise the SCSS files will no longer be loaded. You do not have to include the files in the page layout yourself, the theme already loads them automatically.

Color schemes

By default the NATURE theme comes with a light layout and a green primary color. You can also choose other color schemes:

  • Light color scheme / green primary color
  • Light color scheme / red primary color
  • Light color scheme / blue primary color
  • Dark color scheme / black and white
  • Dark color scheme / green primary color
  • Dark color scheme / red primary color
  • Dark color scheme / blue primary color

All of the color schemes above are adjusted for high contrast to ensure good readability and accessibility.

In addition there is a green and a blue color scheme that is not adjusted for high contrast. These come from an earlier theme version and are still included for backward compatibility.

To switch to a different color scheme, uncomment the corresponding line under Colour Schemes in _custom_variables.scss (or _custom_colors.scss in the older theme version) by removing the slashes. You may need to reload the page with Ctrl + F5 for the change to take effect.

@import 'color_schemes/nature_green_colors_contrast';
//@import 'color_schemes/nature_blue_colors_contrast';
//@import 'color_schemes/nature_red_colors_contrast';

//@import 'color_schemes/nature_dark_colors_contrast';
//@import 'color_schemes/nature_dark_green_colors_contrast';
//@import 'color_schemes/nature_dark_blue_colors_contrast';
//@import 'color_schemes/nature_dark_red_colors_contrast';

//@import 'color_schemes/nature_blue_colors';
//@import 'color_schemes/nature_red_colors';

Activating or deactivating dark mode

Modern operating systems and browsers support dark mode, which displays the user interface with dark backgrounds and lighter text colors – regardless of the device.

In the NATURE theme you activate dark mode by removing the comment characters (//) in front of the import line in _custom_variables.scss (or _custom_colors.scss in older versions):

//@import 'color_schemes/nature_dark_mode';

Variables

Important note If you use the latest version of the NATURE theme, you may wonder where _custom_colors.scss has gone. Don’t worry: as of NATURE version 2.5.0, a new installation of the NATURE theme only has _custom_variables.scss, which now contains all color and variable definitions.

What this means for you:

  • v2 (new installation from version 2.5.0): A new installation of the theme only has _custom_variables.scss with all color and variable settings. Use CSS variables for your customizations.
  • v1 (version older than 2.5.0 / update from a version older than 2.5.0): If you updated the NATURE theme or installed a version older than 2.5.0, both _custom_variables.scss and _custom_colors.scss remain. Use SCSS variables for your customizations.
Tip

ℹ️ How do I update my existing installation to the new version with CSS variables? As of version 2.5.0 the NATURE theme was thoroughly adapted for accessibility and switched to Bulma 1.x. If you want to use all current and future features, you should switch to the new version. You find a detailed guide here: Update from V1 to V2.

​

In our theme you can adjust many styles via CSS variables. They are already prepared in the stylesheet, but commented out by default (with //). To activate or override a variable, simply remove the // at the beginning of the line.

📁 Where to find the variables You find the file for adjusting the variables in the file manager under naturetheme/scss/_custom_variables.scss.

✅ Example: activating a variable

// Vorher (nicht aktiv):
//--bulma-primary: #5ca152;

// Nachher (aktiv):
--bulma-primary: #5ca152;

🧠 Important: two kinds of variables There are two basic kinds of variables, depending on where and how they are defined:

1. Global theme variables (:root) These variables apply site-wide and can be activated or adjusted directly in the :root block. They affect basic design values such as colors, font sizes or spacing.

Example:

:root {
  --bulma-primary: #5ca152;
  --bulma-font-size: 1.2rem;
}

✅ These values are then available everywhere in the theme as var(--bulma-primary) etc.

2. Component-specific variables in CSS classes Some variables only take effect within certain CSS classes or components, e.g. .navbar, .button, .pagination etc. This is because Bulma uses its own class styles for these components, which you have to override specifically.

Example:

.navbar {
  --bulma-navbar-background-color: #eaeaea;
}

⚠️ These variables must be set inside the respective CSS class, otherwise they have no effect.

🔧 The most important CSS variables Here is an overview of the most important CSS variables that you can adjust in naturetheme/scss/_custom_variables.scss.

VariableMeaning
--bulma-primaryPrimary color of the theme
--bulma-primary-invertContrast color to the primary color – e.g. for white text on a colored button
--bulma-primary-bg-textText in the primary color – e.g. for links or headlines on a light background
--bulma-textDefault text color
--bulma-text-invertContrast color for text on a dark background (e.g. –bulma-black)
--bulma-linkLink color
--bulma-link-hoverLink color on hover
--bulma-backgroundPage background color
--bulma-boxes-backgroundBackground color of boxes (e.g. teaser, contact, news, event, form, breadcrumbs)
--bulma-boxes-colorText color in boxes (e.g. teaser, contact, news, event, form, breadcrumbs)
--bulma-infoBackground color for info boxes (see text elements on the demo page)
--bulma-successBackground color for success boxes
--bulma-warningBackground color for warning boxes
--bulma-dangerBackground color for danger boxes
--bulma-family-primaryPrimary font for body text
--bulma-family-headingFont for headings
--bulma-font-sizeBase font size for body text
--bulma-body-line-heightLine height for body text
--bulma-font-weightDefault font weight for text
--bulma-strong-weightFont weight for elements
--bulma-container-paddingPadding of the container (left and right)
--bulma-article-paddingVertical padding of articles or content areas
--bulma-label-colorColor of form labels

In our theme you can adjust many styles via SCSS variables. They are already prepared in the stylesheet, but commented out by default (with //). To activate or override a variable, simply remove the // at the beginning of the line.

Variables in _custom_colors.scss

VariableMeaning
$primaryPrimary color
$textText color
$linkLink color
$link-hoverLink color on hover
$backgroundPage background color
$boxes-backgroundBackground color of boxes,
teaser boxes, contact box, news boxes, event boxes, form fields, breadcrumb etc.
$boxes-colorText color of boxes,
teaser boxes, contact box, news boxes, event boxes, form fields, breadcrumb etc.
$infoBackground color of the info box,
see text elements on the demo page
$successBackground color of the success box,
see text elements on the demo page
$warningBackground color of the warning box,
see text elements on the demo page
$dangerBackground color of the danger box,
see text elements on the demo page

Variables in _custom_variables.scss

_custom_variables.scss already defines various variables to adapt the theme to your needs. The Bulma framework the theme is based on offers even more variables that you can define. You find them for the following elements in the Bulma documentation:

Breadcrumb Buttons Footer Forms Main navigation Modal dialog Pagination Subpage navigation Tables Tabs


Adding a font

If you want to use your own font, you can include it at the very top of _custom_variables.scss.

🔗 Recommendation: fonts via Google Webfonts Helper

A great way to include a font quickly and easily is the site:

👉 Google Webfonts Helper

There you can:

  • choose a font from the Google Fonts library,
  • select the font styles you need,
  • download a ZIP file with the font files,
  • and generate the matching @font-face CSS code right away.
  • Important: Under “Customize Folder prefix”, enter the path to your fonts folder, e.g. /files/naturetheme/fonts/.

📄 Example: adding the CSS to _custom_variables.scss Copy the generated CSS code from the website (e.g. for the font “Ubuntu”) and paste it at the very top of _custom_variables.scss:

/* ubuntu-regular - latin */
@font-face {
  font-display: swap;
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  src: url('/files/naturetheme/fonts/ubuntu-v20-latin-regular.woff2') format('woff2');
}

Then assign the font in the CSS variables as follows:

​
:root {
    --bulma-family-primary: 'Ubuntu', sans-serif;
    --bulma-family-heading: 'Ubuntu', sans-serif;
}
$family-primary: 'Ubuntu', sans-serif;
$family-heading: 'Ubuntu', sans-serif;

Articles

CSS styles

In the article settings under “CSS style selection” you can choose between different predefined layout styles.

🖥️ Article with full screen width This style removes the page margin – the article is displayed across the full screen width, without a left and right margin.

🖥️ Article with full screen height This style makes the article at least as high as the screen. The content is centered vertically – ideal for an intro or a home page.

👉 You find examples on the demo page of the theme.

Changing background and text color

You can easily control the background and text color of an article with CSS classes. For example, the classes has-text-white and has-background-dark give you white text on a dark background.

👉 You find examples in the demo. 👉 For slanted edges with background colors and more details, see the detailed documentation on slanted edges.

You find a complete overview of all available color classes in the official Bulma documentation.