bon*_*708 3 css yaml drupal drupal-theming drupal-8
我正在制作一个新主题,但在加载CSS时遇到问题。尽管我认为对Drupal的文档是正确的,但它不起作用。
我在/ themes / custom / noadin中创建了一个文件夹,并添加了信息和库文件
noadin.info.yml:
name: noadin
description: 'My new theme'
type: theme
core: 8.x
libraries:
- noadin/global-styling
- noadin/global-scripts
Run Code Online (Sandbox Code Playgroud)
并创建了noadin.libraries.yml:
global-styling:
version: VERSION
css:
theme:
css/style.css: {}
global-scripts:
version: VERSION
js:
js/script.js: {}
Run Code Online (Sandbox Code Playgroud)
样式表位于/ themes / custom / noadin / css
谁能告诉我我的误解是什么?
ps Drupal采用了正确的主题。
您的info.yml和libraries.yml看起来不错,我认为可能是因为缓存它没有在清除缓存后尝试加载css和js文件。(登录到您的管理区域配置->开发->性能->清除所有缓存)尝试此操作
您可以尝试查看此工作示例(http://wiki.workassis.com/drupal-8-custom-theme-from-scratch/),这对我有帮助。
| 归档时间: |
|
| 查看次数: |
2254 次 |
| 最近记录: |