[僅限PaaS]{class="badge informative" title="僅適用於雲端專案(Adobe管理的PaaS基礎結構)和內部部署專案的Adobe Commerce 。"}

建立指向LESS檔案的符號連結

WARNING
所有Magento CLI命令都必須由檔案系統擁有者執行。

若要建立LESS檔案的符號連結:

命令選項:

bin/magento dev:source-theme:deploy [--type="..."] [--locale="..."] [--area="..."] [--theme="..."] [file1] ... [fileN]
INFO
在開發期間,這個命令會為var/view_preprocessedpub/static資料夾中的LESS檔案建立符號連結。 此程式不會將LESS檔案編譯成CSS檔案。

下表說明此命令的引數和值。

引數
必填?
--type
來源檔案型別: [less] (預設值: "less")
目前,僅支援LESS檔案型別。
--locale
地區代碼。
若要顯示地區設定代碼清單,請輸入bin/magento info:language:list
--area
區域(adminhtml代表管理區域,frontend代錶店面)。
--theme
<VendorName>/<theme-name>格式的主題名稱。 例如,Magento/blankMagento/backend
<file>
要轉換成LESS而沒有CSS副檔名的CSS檔案清單(以空格分隔)。 (adminhtml型別css/styles-m css/styles-l的預設值為css/styles css/styles-old

例如,若要使用名為VendorName/themeName的CSS檔案,在en_US地區設定中為名為<magento_root>/pub/static/frontend/VendorName/themeName/en_US/css/styles-l.css的前端主題建立LESS檔案,請輸入下列命令:

bin/magento dev:source-theme:deploy --type="less" --locale="en_US" --area="frontend" --theme="VendorName/themeName" css/styles-l

下列訊息會顯示以確認成功:

Processed Area: frontend, Locale: en_US, Theme: VendorName/themeName, File type: less.
-> css/styles-l.less
Successfully processed.

若要為管理員建立LESS檔案:

bin/magento dev:source-theme:deploy --locale="en_US" --area="adminhtml" --theme="Magento/backend" css/styles css/styles-old
recommendation-more-help
386822bd-e32c-40a8-81c2-ed90ad1e198c