Skip to content

global css order error #107

Description

@millievn

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions