Categories
CMS Drupal Mastering Development

Upgrading to Drupal 8, custom theme not using referenced CSS file

I am upgrading a theme from Drupal 7 to Drupal 8. I reference .css files in mytheme.library.yml that do not seem to be getting pulled into the site.

I’ve looked online and even copied sample coding and replace the names appropriately. Yet I do not see them being applied or reference to either .css file, in the source code or Developer Tools.

If these files look correct, then any direction to what could be the cause will be appreciated. If it is permissions, please let me know what permissions it SHOULD be!

I have cleared the cache hundreds of times, after every change, as well as use Incognito Mode so I know it isn’t a browser or site caching issue.

Thank you.

Contents of sites/all/themes/mytheme/mytheme.info.yml

name: MyTheme
type: theme
description: My theme.
core: 8.x
base theme: bootstrap
logo: logo.png

regions:

  navigation: 'Navigation'
  header: 'Top Bar'
  highlighted: 'Highlighted'
  help: 'Help'
  content: 'Content'
  sub_content: 'Sub-content'
  sidebar_first: 'Primary'
  sidebar_second: 'Secondary'
  footer: 'Footer'
  page_top: 'Page top'
  page_bottom: 'Page bottom'
  footer_firstcolumn: 'Footer first column'
  footer_secondcolumn: 'Footer second column'

libraries:
  - mytheme/global-assets

Contents of sites/all/themes/mytheme/mytheme.library.yml

global-assets:
  version: VERSION
  css:
    theme:
      css/main.css: {}
      css/bootstrap.css: {}
  js:
    js/main.js: {}
    js/bootstrap.min.js: {}
    js/enquire.min.js: {}
    js/jquery.main.js: {}

Any help or direction would be appreciated.

Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *