Skip to content

Cant use PostCSS in theme components #461

Closed
@r0skar

Description

@r0skar

When I add styles to the default theme (Layout.vue) like so:

<style lang="postcss" scoped>
.test {
  color: #000000;
}
</style>

I get this error:

ERROR in ./node_modules/vuepress/lib/default-theme/Layout.vue?vue&type=style&index=2&id=25045c01&lang=postcss&scoped=true (./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vuepress/lib/default-theme/Layout.vue?vue&type=style&index=2&id=25045c01&lang=postcss&scoped=true)
Module parse failed: Unexpected token (172:0)
You may need an appropriate loader to handle this file type.
|
|
| .test {
|   color: #000000;
| }
 @ ./node_modules/vuepress/lib/default-theme/Layout.vue?vue&type=style&index=2&id=25045c01&lang=postcss&scoped=true 1:0-146 1:162-165 1:167-310 1:167-310
 @ ./node_modules/vuepress/lib/default-theme/Layout.vue
 @ ./node_modules/vuepress/lib/app/.temp/routes.js
 @ ./node_modules/vuepress/lib/app/app.js
 @ ./node_modules/vuepress/lib/app/clientEntry.js
 @ multi ./node_modules/vuepress/lib/app/clientEntry.js

While this works just fine:

<style src="./styles/theme.css" lang="postcss"></style>

Since Vuepress comes with postcss-loader installed by default, I thought the code above should work out of the box?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementRequest to enhance an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions