Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant use PostCSS in theme components #461

Closed
r0skar opened this issue May 16, 2018 · 3 comments
Closed

Cant use PostCSS in theme components #461

r0skar opened this issue May 16, 2018 · 3 comments
Labels
type: enhancement Request to enhance an existing feature

Comments

@r0skar
Copy link

r0skar commented May 16, 2018

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?

@ulivz ulivz added invalid and removed invalid labels May 16, 2018
@ulivz
Copy link
Member

ulivz commented May 16, 2018

You have some misunderstandings about postcss.

FYI: postcss is not a CSS preprocessor language like sass, less or stylus, as postcss said:

PostCSS is a tool for transforming styles with JS plugins. These plugins can lint your CSS.

so, just remove your lang="postcss".

@ulivz ulivz closed this as completed May 16, 2018
@r0skar
Copy link
Author

r0skar commented May 16, 2018

The problem is that without the lang tag, syntax highlighting in VSCode doesnt work anymore, because Vetur depends on it (vuejs/vetur#506 (comment)). Also see vuejs/vue-cli#1259.

@ulivz
Copy link
Member

ulivz commented May 16, 2018

Oh... the update two days ago!

Updated at 881199a

@ulivz ulivz added the type: enhancement Request to enhance an existing feature label May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Request to enhance an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants