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

global css order error #107

Open
millievn opened this issue Jun 18, 2020 · 0 comments
Open

global css order error #107

millievn opened this issue Jun 18, 2020 · 0 comments

Comments

@millievn
Copy link

millievn commented Jun 18, 2020

I use postcss-modules to handle antd in parcel.

// global.less
@import '~antd/dist/antd.less';
// App.tsx
import '../styles/global.less'

function App(){
 return <Box/>
}
// Box.tsx
import styles from './index.module.scss'
export default function Box() {

  return (
    <Form className={styles['filter-form']}  >
    </Form>
  )
}
// index.module.scss
.filter-form {
  position: relative;
  margin: 20px 0;
  padding: 8px 200px 24px 24px;
  background: #fff;
}
// postcss.config.js

module.exports = {
  modules: true,
  plugins: {
    autoprefixer: {
      grid: true,
    },
    'postcss-modules': {
      globalModulePaths: ['./styles/global.less'],
    },
  },
}

I find the global.less is placed at the bottom and has more priority.
But the module.scss should have higher priority.

demo like this parcel-antd

Anything to deal with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant