question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I override Elements Plus UI default styles in a production environment?

See original GitHub issue

This code is normal in the development environment, but it is overwritten by the Elements Plus UI style in the production environment and will not work.

<el-button  h-14 text-4  mr-8  font-600  type="primary"  p-x="6" @click="goLogin">
  {{ t('website.home.getStart') }}
</el-button>

😵‍💫 So what should I do?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chu121su12commented, Aug 30, 2022

Methodologically, this is css issue. Libraries and UI libraries have their own way of importing additional css with their own ordering. If the import/apply order cannot be altered easily, you have to depend on how css resolve its specificity.

0reactions
kaivanwongcommented, Aug 30, 2022

Well, i think you just need import uno.css after element-plus. In my project, it’s work fine.

import 'element-plus/dist/index.css'
import 'uno.css'

Okay, thank you, but I’m using on-demand import Element Plus’s style. And with the help of Sudongyuer, I used important to solve the problem, but I hope to find the fundamental solution ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue how to override css styles for element-ui - Stack Overflow
Open element.js in the plugins folder. Add import your styles after element-plus, like this: import ElementPlus from "element-plus"; ...
Read more >
4 Ways to Override Material UI Styles | by John Au-Yeung
There are four main methodologies, implemented using pre-built components and hooks, for overriding styling in Material UI:.
Read more >
Theming | Element Plus
Element Plus uses BEM-styled CSS so that you can override styles easily. But if you need to replace styles at a large scale,...
Read more >
Styling Vue components with CSS - Learn web development
To start with, create a file called reset.css in the src/assets directory. Files in this folder get processed by Webpack. This means we...
Read more >
Striking a Balance Between Native and Custom Select Elements
Clicking the box toggles the visibility of the options list (also called listbox). Clicking an option in the listbox updates the selected value ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found