Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 791 Bytes

styling.md

File metadata and controls

30 lines (25 loc) · 791 Bytes

Styling

amp-module adds a custom class to body tag of page, you may use __amp class to target elements only in AMP pages.

.__amp .my-awesome-element {

}

However we recommend to create a separate style file for AMP pages and import it in AMP layout, also remove styles from nuxt.config and import those files in default layout instead.

// default.vue
...
<style>
@import "~/assets/styles/default.css"
</style>

And AMP layout

// default.amp.vue
...
<style>
@import "~/assets/styles/default.amp.css"
</style>

extractCSS behavior

Unfortunately there is no way (at the moment) to support internal and scoped component styles with extractCSS. Even with the removeInlineStyles option turned off. You should copy or move these styles to assets.