CSS Bootstrap 子主题 drupal 8

CSS Bootstrap subtheme drupal 8

所以我尝试将 css 加载到我的页面上,但没有成功。我使用了这种方法 https://www.drupal.org/docs/8/theming-drupal-8/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme 我正在使用 bootstrap 的子主题并将其放入我的

.libraries.yml:

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

并尝试在 style.css 中更改 css 但不起作用。

我的 .info.yml 有:

libraries:
     - 'SUBTHEME/global-styling'

想通了。我必须转到管理 > 配置 > 开发 > 性能并取消选中 "Aggregate CSS files".

我还建议在您的本地环境中设置主题调试:https://www.chapterthree.com/blog/drupal-8-theming-setting-up-theme-debugging(我不隶属于他们,只是一直使用它)。

您应该将“SUBTHEME”一词重写为您的主题名称。如果你的主题名称是 bootstapsubtheme,你应该写

    libraries:
    - 'bootstrapsubtheme/global-styling'

注意,其他文件中有此 "SUBTHEME" 文本,您应该将其重写为您的主题名称。 是的,就像他们上面写的那样,您应该在配置-> 开发-> 性能菜单中关闭聚合 css 和 js 文件,或者清除所有缓存。