5

I'm making a new theme but have problems loading the css. Though I think it is correct to the documentation of Drupal it doesn't work.

I created a folder in /themes/custom/noadin and added the info and libraries files

noadin.info.yml :

name: noadin
description: 'My new theme'
type: theme
core: 8.x
libraries:
  - noadin/global-styling
  - noadin/global-scripts

and created a noadin.libraries.yml :

global-styling:
  version: VERSION
  css:
    theme:
       css/style.css: {}
global-scripts:
  version: VERSION
  js:
    js/script.js: {}

The stylesheet is placed at /themes/custom/noadin/css

Can anyone tell me what it is that I am misunderstanding?

p.s. Drupal is taking the correct theme.

apaderno
  • 28,547
  • 16
  • 75
  • 90
bond708
  • 153
  • 1
  • 6

4 Answers4

6

Your info.yml and libraries.yml looking fine, I think may be becouse of caching it is not loading the css and js file try after clearing the cache. (login to your admin area configuration->Development->Performance->Clear all caches) Try after this

You can try look in to this working sample (http://wiki.workassis.com/drupal-8-custom-theme-from-scratch/) this helped me.

Bikesh M
  • 8,163
  • 6
  • 40
  • 52
  • It'd be best if the accepted answer clarified specifically what is wrong because there are really two different answers here – anthonygore Feb 01 '18 at 05:18
  • 1
    After trying so many things, clearing the cache was the answer, I'm new to Drupal and didn't know how to do that in the admin. – Matthew T Rader Sep 15 '18 at 05:20
1

Please make sure you have unchecked the following option from - Home > Administration > Configuration > Development

Aggregate CSS files -- Uncheck and Save Configuration

Koustav
  • 556
  • 5
  • 7
0

@Koustav answer helped me a lot. I did changed the drupal/sites/default/files to proper owner since the "Bandwidth optimization menu was disabled and then went to

Home > Administration > Configuration > Development

and unchecked the Aggregate CSS files

Now it's working like a charm!

mabreu0
  • 80
  • 2
  • 8
0

I was facing the same issue but resolved by doing the below steps.

  1. Goto admin/config/development/performance
  2. uncheck the Aggregate CSS files
  3. uncheck Aggregate JavaScript files

Thanks!!!!!!!