Support `-webkit-appearance` and `-moz-appearance` in style object
See original GitHub issueCurrent behavior:
I’m trying to hide the up/down arrow in <input type="number">
in Chrome and the recommended way is to add "-webkit-appearance": "none"
and "-moz-appearance": "textfield"
to the input. However when I do:
"input::-webkit-outer-spin-button, input::-webkit-inner-spin-button": {
"-webkitAppearance": "none",
"margin": 0
},
"input[type=number]": {
"-mozAppearance": "textfield"
}
I’m getting an error saying Using kebab-case for css properties in objects is not supported.
even when it renders correctly. I think the problem is that processStyleValue needs to whitelist those attributes.
I also tried this:
"input::-webkit-outer-spin-button, input::-webkit-inner-spin-button": {
"webkitAppearance": "none",
"margin": 0
},
"input[type=number]": {
"mozAppearance": "textfield"
}
But it didn’t get parsed correctly.
Expected behavior:
Users should be able to express -webkit-appearance
and -moz-appearance
via style object. Sorry if this is not an actual bug.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
appearance - CSS: Cascading Style Sheets - MDN Web Docs
The appearance CSS property is used to control native appearance of UI controls, that are based on operating system's theme.
Read more >CSS appearance Property - W3docs
The -moz-appearance property is used in Gecko (Firefox) to show an element using platform-native styling based on the operating system's theme. The -webkit- ......
Read more >CSS -webkit-appearance - GeeksforGeeks
CSS3 has equivalent appearance property to -webkit-appearance property based on the browser compatibility. Such as -webkit- is replaced by -ms- ...
Read more >appearance - CSS-Tricks
The appearance property is used to display an element using a platform-native styling based on the users' operating system's theme.
Read more >CSS Appearance | How does Appearance Property Work in CSS
To add platform-specific style to an item that by default does not have it. To eliminate the unique styling of a platform to...
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 FreeTop 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
Top GitHub Comments
The correct way to write those is this:
You can check out a working example here: https://codesandbox.io/s/rough-field-wooin
This follows the implementation used by Facebook (and thus probably by React itself): https://github.com/facebook/fbjs/blob/0de589c70c0248ec093ca8e35b6aa6bd16fcac5c/packages/fbjs/src/core/hyphenateStyleName.js
@Andarist That doesn’t work with TypeScript. Please try it and you’ll get
Type '{ WebkitAppearance: string; margin: number; }' is not assignable to type 'Interpolation<undefined>'.
compile-time error.