vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.41k stars 26.54k forks source link

[with-ant-design-less] Media definitions require block statements after any features #16037

Closed ManAnRuck closed 1 year ago

ManAnRuck commented 4 years ago

Bug report

Describe the bug

App does not work when using media queries

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. npx create-next-app --example with-ant-design-less
  2. Add media query to antd-custom.less
    
    @primary-color: #52c41a;

@layout-header-height: 40px; @border-radius-base: 2px;

// Add this @media (min-width: @screen-md-min) { @primary-color: #1ab6c4; }

3. start app
4. See error

## Expected behavior

Render without error

## Screenshots

<img width="983" alt="Bildschirmfoto 2020-08-10 um 12 27 47" src="https://user-images.githubusercontent.com/2183135/89773814-ee255e80-db04-11ea-8311-df2f34a32f51.png">

## System information

- OS: macOS
- Browser (if applies) [chrome & safari]
- Version of Next.js: [latest (9.5.1)]
- Version of Node.js: [12.x & 14.x]

## Additional context

error - ./node_modules/antd/lib/button/style/index.less

@primary-color: #52c41a;@layout-header-height: 40px;@border-radius-base: 2px;@media (min-width: @screen-md-min) { @primary-color:#1ab6c4; ^ Media definitions require block statements after any features in …/with-ant-design-less/node_modules/antd/lib/button/style/index.less (line 227, column 25) at runMicrotasks ()

golinmarq commented 3 years ago

It is any option to solve this. I'm trying to solve it myself but I failed =(

ManAnRuck commented 3 years ago

until now, I didn't find a solution. @timneutkens @ijjk any idea?

charlzyx commented 3 years ago

try this https://github.com/SolidZORO/next-plugin-antd-less/blob/master/index.js

jankaifer commented 1 year ago

Hi, this issue is 2 years old now. Is it still relevant? Could you try it again with next@canary?

jankaifer commented 1 year ago

Closing because the example was actually removed.

github-actions[bot] commented 1 year ago

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.