Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By emielschumacher on
Hello everyone,
I'm trying to use a CSS file for styling the Stark theme.
How can I use a CSS file for styling the Stark 8.0.1(core) theme?
stark.info.yml
name: Stark
type: theme
description: 'An intentionally plain theme with no styling to demonstrate default Drupal’s HTML and CSS. Learn how to build a custom theme from Stark in the <a href="https://www.drupal.org/theme-guide">Theming Guide</a>.'
package: Core
# version: VERSION
# core: 8.x
base theme: false
# Information added by Drupal.org packaging script on 2015-12-02
version: '8.0.1'
core: '8.x'
project: 'drupal'
datestamp: 1449067409
stark.libraries.yml
global-styling:
version: 1.x
css:
theme:
css/layout.css: {}
The 'stark.libraries.yml' file says that he css/layout.css include. When I add CSS styling in the layout.css it doesn't work.
I hope someone can help me.
Comments
You need to load the library,
You need to load the library, the easy way is in the info.yml file
https://www.drupal.org/theme-guide/8/assets
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Still doesn't help
I added in that line into the info.yml file and stark is still not changing at all based on any css I add to the global-styling file.
You will need to clear the
You will need to clear the cache after changes in the info- or libraries-files.