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! 

Thank you.

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

/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: {}

I've already been converting the template files to twig, and that has been an adventure. ;)

Comments

hometoy’s picture

Does upgrading this theme require the base theme (bootstrap) to be updated as well.

And where does the block layout get defined?  I do have the block laid out on the page and I suspect it is coming from the page.html.twig file.

VM’s picture

Does upgrading this theme require the base theme (bootstrap) to be updated as well.

yes. Bootstrap for Drupal 8 should be used.

And where does the block layout get defined?

Block layouts start with block.html.twig. Suggest reviewing the following documentation (if you've not yet done so): https://www.drupal.org/docs/8/theming

hometoy’s picture

I actually found out it was a "duh" issue for the CSS; I named the file "library" when it needs to be "libraries"!  Once I changed it, then the CSS goodies started showing up.

It's not perfect, and I still have a lot of work, but at least I am moving forward again.