NInput error with hsl theme primary color
See original GitHub issueTuSimple/naive-ui version (版本)
2.33.3
Vue version (Vue 版本)
3.2.39
Browser and its version (浏览器及其版本)
Chrome/104.0.5112.126
System and its version (系统及其版本)
Archlinux
Node version (Node 版本)
18.9.0
Reappearance link (重现链接)
https://github.com/M1CK431/naiveui-input-issue
Reappearance steps (重现步骤)
- Start the dev server with
yarn dev
- Open it in your browser
- Open dev tools console
Expected results (期望的结果)
NInput
component is displayed and no console error
Actual results (实际的结果)
No render at all and console error:
Uncaught Error: [seemly/rgba]: Invalid color value hsl(350deg 78% 56%).
Remarks (补充说明)
The key here is the use of hsl
color as theme primaryColor
.
I try with NButton
component and it works so it really seems to be specific with NInput
but I haven’t try with all NaiveUI component.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Using HSL Colors In CSS - Smashing Magazine
The main header navigation has the primary color, while the secondary navigation has a lighter shade. With HSL, we can get the lighter...
Read more >How to use HSL color in CSS like a pro | TSH.io
HSL (Hue, Saturation and Lightness) is the color representation. · To read the color, first you need to take a look at hue...
Read more >hsl() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The hsl() functional notation expresses an sRGB color according to its hue, saturation, and lightness components.
Read more >CSS variables in Material ui - createMuiTheme - Stack Overflow
This throws an error: Uncaught Error: Material-UI: Unsupported var(--primary-color) color. We support the following formats: #nnn, #nnnnnn, rgb ...
Read more >Support additional colors outside primary, accent, warn #11888
Apps can use alternative colors to establish themes that distinguish ... since primary colored input fields look like they are in error.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I could solve the issue easily but I have to add a MIT license file and I dunno if you are okay with that 😞
It is possible. If
changeColor
can support more format that’s great. I simply don’t want it to be that complex since rgba is enough for most cases and converting them is not a hard job.