Create a theme
Create a theme
Each individual theme is contained in a directory named after the theme itself. For example fluffiness/.
The name must be all lowercase, start with a letter, and uses an underscore (_) instead of spaces.
This name will be important, a lot of files will have a reference to this name.
Changing the name later can be annoying.
Create a theme
Your Drupal installation already contains a number of themes.
As example check these out:
In our new folder (F.E.: /themes/fluffiness) add a new file. Name this file:
<themename.info.yml>
F.E.:
This name must be the same as the folder name!
Look at /core/profiles/demo_umami/themes/umami/umami.info.yml
Copy the contents to your own info.yml file
Change the following key/value pairs:
Change the following key/value pairs:
Remove the following key/value pairs:
Go to your site, to the appearance page:
Find your newly created theme and hit Install & set as default
If all went well your theme should be active, and your site will look like this:
If you use new/different regions, you will have to place the blocks in the correct/new regions.
Go to:
/admin/structure/blocks
Create a theme
In your theme, add a new folder: css
/themes/fluffiness/css
In this folder, create a new file: styles.css
/themes/fluffiness/css/styles.css
In your theme, add a new file: <themename>.libraries.yml
/themes/fluffiness/fluffiness.libraries.yml
Look at the classy.libraries.yml file
Copy the first 4 lines to your library file:
global:
version: VERSION
css:
component:
css/styles.css: {}
Rename base.css
to styles.css
In your theme's info.yml file, add the following code:
libraries:
- fluffiness/global
Add some CSS to your css/styles.css file for testing
F.E.:
Clear caches, refresh home & check result.
body {
background-color: hotpink;
}
Create a theme
Want to use assets for you CSS?
Add a new folder: images
/themes/fluffiness/assets
Add theme-assets to this folder:
You can these use these assets in your theme CSS:
background: url('/themes/fluffiness/assets/images/cat.jpg')
Create a theme
You can add your own .svg logo to the theme, just place it like this:
This logo will automatically be used
Want a non-svg logo? Add it through:
/admin/appearance/settings/d8theming
Create a theme
Add a screenshot.png/.gif file to the theme:
This logo will automatically be used