day8 / re-com

A ClojureScript library of reusable components for Reagent
https://re-com.day8.com.au
MIT License
798 stars 147 forks source link

Feature request: automatic webkitification of applicable attrs #100

Open johanatan opened 8 years ago

johanatan commented 8 years ago

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].

Gregg8 commented 7 years ago

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.

johanatan commented 7 years ago

Yes, general.

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