2016-09-23 45 views
0

我創建了一個名爲'gvtheme'的自定義Magento 2主題。 css的文件夾佈局是:frontend-> Magento-> gvtheme-> web-> css-> source-> style.cssMagento 2自定義主題css不顯示

在style.css中我已經把body:background-color:red;只是爲了測試它是否工作。當我檢查鉻標籤中的身體標記時,它並未顯示出來,甚至沒有被重寫。

在Magento 2後端的Content/Design/Configuration中,它顯示'Default Store View'和其他兩個視圖以'gvtheme'爲主題。它以前顯示爲'Luma'。 在網站的前端,它不再顯示'Luma'徽標和風格。我刷新了所有緩存,包括'刷新Javascript/CSS緩存'。 有沒有人有任何想法,爲什麼這可能不工作? 任何幫助將不勝感激!

+0

你可以試着問這個在magento.stackexhange.com。 – jmargolisvt

+0

謝謝jmargolistv,我會那樣做的! –

回答

1

原來我需要添加'custom-theme' - >'Magento_Theme' - >'layout' - >'default_head_blocks.xml'。在該文件中我需要添加:

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> 
<head> 
    <css src="css/source/style.css" /> 
</head>