Skip to content

Commit

Permalink
feat: use postcss preset 1 for nesting support
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Jun 6, 2019
1 parent d5beede commit e80dcc5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 11 additions & 5 deletions example/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="bg-indigo-900 text-center py-4 lg:px-4">
<div class="banner">
<div class="p-2 bg-indigo-800 items-center text-indigo-100 leading-none lg:rounded-full flex lg:inline-flex" role="alert">
<span class="flex rounded-full bg-indigo-500 uppercase px-2 py-1 text-xs font-bold mr-3">New</span>
<span class="font-semibold mr-2 text-left flex-auto">Get the coolest t-shirts from our brand new store</span>
Expand All @@ -8,8 +8,14 @@
</div>
</template>

<script>
export default {
<style scoped>
.banner {
@apply bg-indigo-900 text-center py-4;
@screen lg {
@apply px-4
}
&:hover {
@apply bg-indigo-800;
}
}
</script>
</style>
1 change: 1 addition & 0 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = async function (moduleOptions) {
** Set PostCSS config
** It has to be set before `nuxt-purgecss`
*/
this.options.build.postcss.preset.stage = 1 // see https://tailwindcss.com/docs/using-with-preprocessors#future-css-features

This comment has been minimized.

Copy link
@clarkdo

clarkdo Jun 6, 2019

@atinux What do you think adding a log for here (only in dev mode), like postcss-preset-env stage is configured as 1 for supporting tailwindcss features ?

This comment has been minimized.

Copy link
@atinux

atinux Jun 11, 2019

Author Collaborator

Will add, thanks @clarkdo

this.options.build.postcss.plugins = this.options.build.postcss.plugins || {}
this.options.build.postcss.plugins.tailwindcss = this.options.build.postcss.plugins.tailwindcss || resolve(srcDir, 'tailwind.config.js')

Expand Down

0 comments on commit e80dcc5

Please sign in to comment.