CSS Imports (@import) not working as expected #1001
-
I tried this new feature CSS Imports (@import), but it seems not working correctly. Steps to reproduce:
@import 'antd/dist/antd.css';
import React from 'react';
import {Button} from 'antd/es';
import './App.css';
const App = () => <Button type="primary">antd</Button>;
export default App;
OutputsThe resolved step seems fine, ❯ tree build/web_modules/antd/
build/web_modules/antd/
├── dist
│ ├── antd.css
│ └── antd.css.proxy.js
└── es.js But the
@import "../web_modules/antd/dist/antd.css.proxy.js"
... which imports nothing and leads the button unstyled.
it looks like the following code replaced the BTW, I can use import import 'antd/dist/antd.css'; to use styles of antd, but it seems to be a bug related to snowpack's |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Thanks for filing! Just submitted a quick fix here: #1003 |
Beta Was this translation helpful? Give feedback.
-
How did you make it work? To me, the styles, even though downloaded, simply are not applied at all. |
Beta Was this translation helpful? Give feedback.
Thanks for filing! Just submitted a quick fix here: #1003