New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gradient syntax to save bytes and to be future-proof #2795

Closed
myakura opened this Issue Oct 21, 2011 · 0 comments

Comments

Projects
None yet
2 participants
@myakura
Contributor

myakura commented Oct 21, 2011

The latest CSS3 Images has changed the syntax of linear-gradient. If we want a top-to-bottom gradient we write linear-gradient(to bottom, [...]) instead of linear-gradient(top, [...]). So we need to update unprefixed rules in theme CSS.

However, the spec has been stating that if the gradient goes from top to bottom we can omit keywords. And browsers that support gradients understand this omission.

So why don't we update the whole gradient syntax by dropping all the top, s, like:

background-image: -webkit-linear-gradient(#3c3c3c, #111);
background-image:    -moz-linear-gradient(#3c3c3c, #111);
background-image:     -ms-linear-gradient(#3c3c3c, #111);
background-image:      -o-linear-gradient(#3c3c3c, #111);
background-image:         linear-gradient(#3c3c3c, #111);

rather than changing only the unprefixed rules like:

background-image: -webkit-linear-gradient(top, #3c3c3c, #111);
background-image:    -moz-linear-gradient(top, #3c3c3c, #111);
background-image:     -ms-linear-gradient(top, #3c3c3c, #111);
background-image:      -o-linear-gradient(top, #3c3c3c, #111);
background-image:         linear-gradient(to bottom, #3c3c3c, #111);

The former is future-proof too and it also saves a few bytes.

toddparker added a commit that referenced this issue Oct 31, 2011

Merge pull request #2796 from myakura/bug_2795
Fix for the issue #2795. Thanks myakura!

timmywil pushed a commit to timmywil/jquery-mobile that referenced this issue Nov 5, 2011

Merge pull request #2796 from myakura/bug_2795
Fix for the issue #2795. Thanks myakura!

@toddparker toddparker closed this Nov 13, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment