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.

4 Answers 4

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.

Sign up to request clarification or add additional context in comments.

2 Comments

It'd be best if the accepted answer clarified specifically what is wrong because there are really two different answers here
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.
1

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

Aggregate CSS files -- Uncheck and Save Configuration

Comments

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!

Comments

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!!!!!!!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.