質問

I recently downloaded sublime text 3 along with autoPrefixr. I got node.js and made sure it is in the $PATH. I restarted sublime text, yet when i try to run autoPrefixr, it only adds like 10 lines of code to my 150 lines of css. I know it's not doing it's job because I see nothing about -moz- or -o-. Please help as soon as possible, and thanks in advance.

役に立ちましたか?

解決

Look for -webkit- prefixes. The reason you're not seeing very many changes is that, by default, the settings are to support the last two versions of each browser. Recent versions of Firefox and Opera don't require the -moz- and -o- prefixes, respectively, to many CSS items, which is the reason you're not seeing them.

To test earlier versions of Firefox and Opera, first create the following generic CSS:

body {
    transition: all 1s ease-out;
}

p {
    transform: skewx(10deg) translatex(150px);
}

Then, go to Preferences -> Package Settings -> Autoprefixer -> Settings - User and set its content to the following:

{
    "browsers": ["last 2 versions", "> 10%", "ff > 4", "opera > 9"]
}

This adds support for the last two versions of any browser, any version with greater than 10% market share, Firefox versions 4 and above, and Opera versions 9 and above.


Save this content, go back to your test CSS file, and run Autoprefix CSS from the Command Palette. You should now get the following:

body {
    -webkit-transition: all 1s ease-out;
    -moz-transition: all 1s ease-out;
    -o-transition: all 1s ease-out;
    transition: all 1s ease-out;
}

p {
    -webkit-transform: skewx(10deg) translatex (150px);
    -moz-transform: skewx(10deg) translatex (150px);
    -o-transform: skewx(10deg) translatex (150px);
    transform: skewx(10deg) translatex (150px);
}

For more (brief) details about the settings, check the README.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top