Skip to content

Commit

Permalink
Update info on previewMedia (#1304)
Browse files Browse the repository at this point in the history
* Update info on previewMedia

* Update guides/plugins/themes/theme-configuration.md

Co-authored-by: Tobias Berge <[email protected]>

* Update guides/plugins/themes/theme-configuration.md

---------

Co-authored-by: Tobias Berge <[email protected]>
  • Loading branch information
sushmangupta and tobiasberge authored Feb 22, 2024
1 parent be5fbad commit 4207c3f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions guides/plugins/themes/theme-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ The theme configuration for a theme is located in the `theme.json` file `<plugin
{
"name": "SwagBasicExampleTheme",
"author": "Shopware AG",
"description": {
"en-GB": "My custom theme",
"de-DE": "Mein custom thema"
},
"views": [
"@Storefront",
"@Plugins",
"@SwagBasicExampleTheme"
],
"previewMedia": "app/storefront/dist/assets/defaultThemePreview.jpg",
"style": [
"app/storefront/src/scss/overrides.scss",
"@Storefront",
Expand Down Expand Up @@ -91,6 +96,17 @@ The `views` section controls the template inheritance. This will be covered in t
}
```

The `previewMedia` field provides a path `app/storefront/dist/assets/defaultThemePreview.jpg` to an image file that is relative to the root directory of the theme. It serves as a visual preview of the theme. This preview image is typically displayed within the Shopware administration interface or theme marketplace as a thumbnail or preview of the theme's appearance to give users an idea of how the theme will appear on their storefront before they activate it.

```js
// <plugin root>/src/Resources/theme.json
{
...
"previewMedia": "app/storefront/dist/assets/defaultThemePreview.jpg",
...
}
```

The `style` section determines the order of the CSS compilation. In the `<plugin root>/app/storefront/src/scss/base.scss` file you can apply your changes you want to make to the `@Storefront` standard styles or add other styles you need. The `<plugin root>/app/storefront/src/scss/overrides.scss` file is used for a special case. Maybe you need to override some defined `variables` or `functions` defined by Shopware or Bootstrap, you can implement your changes here. Checkout the [Override bootstrap variables in a theme](override-bootstrap-variables-in-a-theme) guide for further information.

```js
Expand Down

0 comments on commit 4207c3f

Please sign in to comment.