Drupal:子主题CSS不起作用

时间:2017-12-25 20:03:58

标签: php css drupal yaml

我是Drupal初学者。 我设置了一个Drupal Sub主题,它被激活并正常工作。 我参加了Bootstrap主题。 现在我试图添加我的自定义CSS。

这是我的树:
enter image description here

libraries.yml

global-styling:
  css:
    theme:
      css/style.css: {}

info.yml

core: 8.x
type: theme
base theme: bootstrap

name: 'Recipes'
description: 'Uses the jsDelivr CDN for all CSS and JavaScript. No source files or compiling is necessary and is recommended for simple sites or beginners.'
package: 'Bootstrap'

regions:
  navigation: 'Navigation'
  navigation_collapsible: 'Navigation (Collapsible)'
  header: 'Top Bar'
  highlighted: 'Highlighted'
  help: 'Help'
  content: 'Content'
  sidebar_first: 'Primary'
  sidebar_second: 'Secondary'
  footer: 'Footer'
  page_top: 'Page top'
  page_bottom: 'Page bottom'
  myregion: 'meine neue Region'

libraries:
  - 'recipes/global-styling'

我希望你能帮助我:)。

2 个答案:

答案 0 :(得分:0)

试试这个

<强> libraries.yml

global-styling:
  version: VERSION
  css:
    base:
      css/style.css: {}

<强> info.yml

libraries:
  - recipes/global-styling

答案 1 :(得分:0)

您的解决方案应该可行,您必须从管理员或数据库中清除缓存。它可以工作,就像我一样。

global-styling:
  css:
    theme:
      css/style.css: {}
      css/custom.css: {}

libraries:
  - 'bootstrap_subtheme/global-styling'

由于