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

Jeff Burnz’s picture

You need to load the library, the easy way is in the info.yml file

libraries:
  - stark/global-styling

https://www.drupal.org/theme-guide/8/assets

pburd’s picture

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.

quotientix’s picture

You will need to clear the cache after changes in the info- or libraries-files.