Legacy Knowledge Base
公開されました Jul. 2, 2025

テーマ構築時にError: Compound Selectors may no longer to be extendedが発生しました。

Written By

Pooja Bhambani

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • カスタマイズしていない素のテーマを作成すると、ビルド時に以下のエラーが発生します:
    [14:26:26] 'build:compile-css' errored after 4.9 s
    [14:26:26] Error in plugin "sass"
    Message:
        build/_css/compat/components/_dropdowns.scss
    Error: compound selectors may no longer be extended.
    Consider `@extend .dropdown-item, .disabled` instead.
    See http://bit.ly/ExtendCompound for details.
    
       ╷
    34 │         @extend .dropdown-item.disabled;
       │                 ^^^^^^^^^^^^^^^^^^^^^^^
       ╵
      build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
    Details:
        formatted: Error: compound selectors may no longer be extended.
    Consider `@extend .dropdown-item, .disabled` instead.
    See http://bit.ly/ExtendCompound for details.
    
       ╷
    34 │         @extend .dropdown-item.disabled;
       │                 ^^^^^^^^^^^^^^^^^^^^^^^
       ╵
      build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
        line: 34
        column: 11
        file: /Users/jordi/Downloads/Liferay/test1-theme/build/_css/compat/components/_dropdowns.scss
        status: 1
        messageFormatted: build/_css/compat/components/_dropdowns.scss
    Error: compound selectors may no longer be extended.
    Consider `@extend .dropdown-item, .disabled` instead.
    See http://bit.ly/ExtendCompound for details.
    
       ╷
    34 │         @extend .dropdown-item.disabled;
       │                 ^^^^^^^^^^^^^^^^^^^^^^^
       ╵
      build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
        messageOriginal: compound selectors may no longer be extended.
    Consider `@extend .dropdown-item, .disabled` instead.
    See http://bit.ly/ExtendCompound for details.
    
       ╷
    34 │         @extend .dropdown-item.disabled;
       │                 ^^^^^^^^^^^^^^^^^^^^^^^
       ╵
      build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
        relativePath: build/_css/compat/components/_dropdowns.scss
        domainEmitter: [object Object]
        domainThrown: false
    
    [14:26:26] 'build' errored after 5.96 s

Environment

  • Liferay DXP 7.3
  • node -v 14.17.0
  • npm -v 6.14.13

解決策

  • js-themes-toolkitでは、プリプロセッサをLibsassからDart Sassに変更しました。 そして、Dart Sassは、古いテーマのビルドが失敗するような壊れやすい変更を導入しています。
  • テーマを構築するには、設定ファイル 、Dart Sassを無効にして、現在の基本的なツールを使用するために進み続けます。
    package.json:
    	"liferayTheme": {
    		"sassOptions": {
    			"dartSass": false
    		},
    		//...
    	},

追加情報

Did this article resolve your issue ?

Legacy Knowledge Base