0

Theme mytheme is placed under /sites/all/themes/

Content of mytheme.info.yml :

name: My Theme
type: theme
description: Custom theme.
core: 8.x
base theme: classy
version: 8.x-1.0
libraries:
  - mytheme/global-styling
regions:
  logo: 'Logo'
  navigation: 'Navigation'
  page_header: 'Page Header'
  content: Content  # the content region is required
  page_sidebar: 'Page Sidebar'
  contact_first: 'Contact (First column)'
  contact_second: 'Contact (Second column)'
  contact_third: 'Contact (Third column)'
  footer_logo: 'Footer logo'
  footer_first: 'Footer first'
  footer_second: 'Footer second'
  footer_third: 'Footer third'
  footer_copyright: 'Footer Copyright'
regions_hidden:
  - sidebar_first

Content of mytheme.libraries.yml :

global-styling:
  version: 1.x
  css:
    theme:
      assets/plugins/bootstrap/css/bootstrap.min.css: { minified: true }
      assets/plugins/font-awesome/css/font-awesome.min.css: { minified: true }
      assets/css/style.css: {}
      assets/fonts/montserrat/montserrat.css: {}
  js:
    assets/plugins/jquery-1.11.1.min.js: { minified: true }
    assets/plugins/bootstrap/js/bootstrap.min.js: { minified: true }
    assets/plugins/moderniz.js: {}
    assets/js/app.js: {}
  dependencies:
    - core/jquery
    - core/drupal
    - core/drupalSettings

The JS is loading but the CSS isn't. How come?

2
  • If you replace // with https://, does it work? Just trying to validate the issue is the // at the beginning.
    – rovr138
    Mar 21, 2017 at 14:01
  • I removed the line. It has no effect.
    – Pim
    Mar 21, 2017 at 15:19

1 Answer 1

0

try wrapping the google fonts entry in quotes like this:

'//fonts.googleapis.com/css?
family=Open+Sans:400,300,600⊂=latin,cyrillic': { type: external }

Maybe there is a problem with the url using yaml special characters https://stackoverflow.com/questions/19109912/do-i-need-quotes-for-strings-in-yaml#22235064

1
  • Unfortunately... doesn't work!
    – Pim
    Mar 21, 2017 at 13:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.