re-com icon indicating copy to clipboard operation
re-com copied to clipboard

Feature request: automatic webkitification of applicable attrs

Open johanatan opened this issue 9 years ago • 2 comments

Hi,

It seems like this function would be good to apply to all styles coming into re-com (as it doesn't seem to be the sort of thing that everyone will want to define for themselves):

(defn wk [styles]
  (let [attrs [:flex :flex-flow :align-items :align-self]
        mapping (zipmap attrs (map (fn [a] (keyword (str "-webkit-" (name a)))) attrs))]
    (merge styles (rename-keys (select-keys styles attrs) mapping))))

[The attrs list is of course incomplete at this point].

johanatan avatar Jul 09 '16 00:07 johanatan

Could you provide more detail? Is this to solve a specific problem you are having? Or just a general cross-browser thing?

We're not in favour of this as web prefixes are being added and (more often) removed fairly regularly and this would require continuous maintenance.

For example, see this link for flexbox styles: http://caniuse.com/#search=flexbox which suggests that prefixes are no longer required.

Gregg8 avatar Sep 19 '16 00:09 Gregg8

Yes, general.

Prefixes are certainly still required-- not sure how that link proves any different...

johanatan avatar Sep 19 '16 00:09 johanatan