-1

i made a custom theme in drupal like this

my info.yml

name: Custom Theme
type: theme
description: 'Custom Theme for My Website.'
package: Other
core: 8.x
libraries:
- custom_theme/global-styling

base theme: classy

regions:
  header: Header
  primary_menu: 'Primary menu'
  secondary_menu: 'Secondary menu'
  page_top: 'Page top'
  page_bottom: 'Page bottom'
  highlighted: Highlighted
  featured_top: 'Featured top'
  breadcrumb: Breadcrumb
  content: Content
  sidebar_first: 'Sidebar first'
  sidebar_second: 'Sidebar second'
  featured_bottom_first: 'Featured bottom first'
  featured_bottom_second: 'Featured bottom second'
  featured_bottom_third: 'Featured bottom third'
  footer_first: 'Footer first'
  footer_second: 'Footer second'
  footer_third: 'Footer third'
  footer_fourth: 'Footer fourth'
  footer_fifth: 'Footer fifth'

my libraries.yml

global-styling:
version: 1.x
 js:
js/script.js: {}
 css:
theme:
css/style.css: {}

but it uses stable theme css file instead of my custom theme css. any idea why?

i tried to clear the cashe and it wasn't the problem and i tried to override like this but im not sure if its correct and it didn't work either

libraries-override:
  block/drupal.block.admin.css:
     css:
      theme:
        stable/css/block/block.admin.css: false 
4

1 回答 1

0

可能是您的 info.yml 和 library.yml 没有正确的缩进。应该是这样的

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

没有制表符,使用空格。

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

name: 'Custom Theme'
description: 'Custom Theme for My Website.'
libraries:
  - custom_theme/global-styling
于 2021-01-19T15:34:27.197 回答