Skip to content

Commit f78b9c1

Browse files
committed
[css-ui-4] Add warning about appearance
1 parent 38f4476 commit f78b9c1

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

css-ui-4/Overview.bs

+75
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,81 @@ so this specification allows flexibility.
22132213

22142214
<h3 id="appearance-switching" caniuse="css-appearance">Switching appearance</h3>
22152215

2216+
<div class=issue>
2217+
<strong>This is not ready for shipping</strong> (see <a href="https://github.com/w3c/csswg-drafts/issues/1250">Github issue 1250</a>).
2218+
2219+
This previously existed as a prefixed form in most browsers.
2220+
Before standardization, in addition to none,
2221+
the possible values were a very long list of all the ways an element could look;
2222+
this list was different across browsers.
2223+
2224+
We concluded this was impossible to standardize,
2225+
in part because many apply to pseudo-elements that other browsers don't have,
2226+
as they construct form elements differently.
2227+
2228+
Instead, we'd just have an "auto" value that makes form controls look like whatever they need,
2229+
and a "none" value that suppresses "native" look.
2230+
2231+
However, there is evidence that this may not be web compatible,
2232+
due in part to uses such as:
2233+
<pre><code highlight=css>
2234+
input { appearance: none; }
2235+
input[type=checkbox] { appearance: checkbox; }
2236+
</code></pre>
2237+
2238+
Such code is sometimes limited to the vendor-prefixed variant of this property,
2239+
but not always,
2240+
as authors often include the prefixless version for the sake of future proofing
2241+
2242+
Due to substantially different behavior,
2243+
naïve aliasing of 'appearance' and of ''-webkit-appearance'' is unlikely to work.
2244+
2245+
Possible ways forward include:
2246+
2247+
<ol>
2248+
<li>Keep the design as is, if the compatibility problem is not that serious
2249+
2250+
<li>Keep the current design,
2251+
and add a handful of values other than ''appearance/none'' and ''appearance/auto''.
2252+
The design of this property does not preclude having other values.
2253+
As long as we have the ''appearance/auto'' value,
2254+
there is no need to be exhaustive.
2255+
2256+
<li>Keep the current design,
2257+
but also accept other values (possibly white-listed, possibly accept anything)
2258+
and let them behave the same as ''appearance/auto''.
2259+
As demonstrated in the example above,
2260+
common uses of values other than ''appearance/none'' and ''appearance/auto''
2261+
are not to switch an element's appearance into something else,
2262+
nor to give a native look to something that didn't have one,
2263+
but merely to undo a previously applied ''appearance/none''.
2264+
Since ''appearance/auto'' did not exist in the non standard version,
2265+
authors have been using specific values for this purpose,
2266+
but the behavior of ''appearance/auto'' would be sufficient.
2267+
2268+
<li>Combine the previous two options,
2269+
adding a handful of explicit values with specific behaviors,
2270+
and also accept any other value letting them behave the same as ''appearance/auto''.
2271+
2272+
<li>Abandon the current design,
2273+
and specify instead the behavior of ''-webkit-appearance'',
2274+
without an ''appearance/auto'' value and with all the permutations instead.
2275+
This probably requires specifying a few pseudo-elements as well,
2276+
as various values of the ''-webkit-appearance'' property
2277+
are used to style sub-components of form controls.
2278+
</ol>
2279+
2280+
Based on Microsoft's experience, it seems that the 3rd option in this list may be sufficient.
2281+
This would be fairly cheap in terms of specification and implementation effort.
2282+
2283+
Option 2 is somewhat more costly but reasonably so,
2284+
while option 5 is significantly more costly.
2285+
2286+
More feedback from implementors is needed
2287+
about the extent and nature of the compatibility problem,
2288+
and about which option may adequately address it.
2289+
</div>
2290+
22162291
While the way most elements in a document look can be fully controlled by CSS,
22172292
form controls are typically rendered by UAs using native UI controls of the host operating system,
22182293
which can neither be replicated nor styled using CSS.

0 commit comments

Comments
 (0)