oscarotero/stylecow

String values including a property name get "prefixed"

Closed this issue · 4 comments

I have an example like

.device {
    display: block;
    box-sizing: border-box !important;
    *behavior: url(/assets/site/css/style.ie.box-sizing.htc);
    overflow: hidden;
}

/* which gets transformed into */

.device {
    display: block;
    -moz-box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
    box-sizing: border-box !important;
    *behavior: url(/assets/site/css/style.ie.-moz-box-sizing.htc);
    *behavior: url(/assets/site/css/style.ie.-webkit-box-sizing.htc);
    *behavior: url(/assets/site/css/style.ie.box-sizing.htc);
    overflow: hidden;
}

sure it can be solved by not having the property name box-sizing in the filename of the linked file, but I would consider it a bug anyways, as the vendor prefix plugin should just transform properties, as far as I understand, not the values =).

thanks anyways for your great work, keep it up!

I think it comes from that definition:

        array(
            'value' => 'box',
            'fn' => array(
                'addValuesVendorPrefixes' => array('moz', 'webkit')
            )
        )

in the vendor prefixes plugin (line 1543).

The problem with my filename is thereafter not the whole box-sizing thing, but the term "box" itself which is coming from old flexbox syntax for webkits and ff...the plugin seems to make no difference in what kind of value the property has, e.g. an url, as long as it contains the "search" word...any chance to avoid changing strings at all?

Thank you, exside.
I'm, planning to rewrite this library with the same strategy than the node version (https://github.com/oscarotero/stylecow-node) and this plugin will use regular expression, like the node version: https://github.com/oscarotero/stylecow-node/blob/master/lib/plugins/vendorPrefixes.js) to detect and insert vendor prefixes.

hey, sounds great =), will have a look at it shortly!

Edit: hm, what about the whole browser version sniffing thing? That would require a recompilation for each visitor right? I actually don't care too much if there are some unneccessary prefixes around, sure, would be nice if not (maybe by specifying the desired supported min browser version in config or something like that)...but if it makes the compiling much slower I'd rater have some too much =)

In the node version (and future php version) you configure the minimum browser version. there is not a recompilation for each visitor (unless you want to do this, but it's a bad idea :)