Created
March 7, 2012 18:38
-
-
Save nimbupani/1995024 to your computer and use it in GitHub Desktop.
Trying some ideas for prefix solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 { | |
-webkit-border-radius: 10px; | |
-moz-border-radius: 10px; | |
-ms-border-radius: 10px; | |
-o-border-radius: 10px; | |
border-radius: 10px; | |
} | |
body { | |
background-image: -webkit-gradient(linear, #000, #fff), url('image.png'); | |
background-image: -webkit-linear-gradient(#000, #fff), url('image.png'); | |
background-image: -moz-linear-gradient(#000, #fff), url('image.png'); | |
background-image: -ms-linear-gradient(#000, #fff), url('image.png'); | |
background-image: -o-linear-gradient(#000, #fff), url('image.png'); | |
background-image: linear-gradient(#000, #fff), url('image.png'); | |
} | |
body { | |
display: -webkit-flexbox; | |
display: -moz-flexbox; | |
display: -ms-flexbox; | |
display: -o-flexbox; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 { | |
@prefixed(border-radius: 10px); | |
} | |
body { | |
@prefixed(background-image: linear-gradient(#000, #fff), url('image.png')); | |
} | |
//Ambitious | |
body { | |
@prefixed(display: flexbox, ($official: false, $oldwebkit: false)); | |
} |
neat! I think @chriseppstein came up with a more elegant solution:
div {
@include prefixed {
border-radius: 5px;
display: flexbox;
background-image: linear-gradient(#000, #fff);
}
}
My intention was to not split property and value, and try to apply the prefixes automatically to a declaration.
That is elegant. If it can be broken down into an array seems like it wouldn't be too hard to spit back out with proper prefixes. You and @chriseppstein working to bake this into Sass/Compass? That would be awesome :)
Essentially trying to find a less unwieldy solution to setting prefixes!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sass always does the trick :)
Here is my solution: https://github.com/scottkellum/Seasons/blob/master/sass/lib/tools/_css3.sass
Taking the time to sync it with this table so prefixes are used only where needed: http://peter.sh/experiments/vendor-prefixed-css-property-overview/