Skip to content
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

Remove default values from shorthand declarations #164

Closed
GoalSmashers opened this issue Nov 2, 2013 · 7 comments
Closed

Remove default values from shorthand declarations #164

GoalSmashers opened this issue Nov 2, 2013 · 7 comments
Assignees
Milestone

Comments

@GoalSmashers
Copy link
Contributor

a{background:transparent url(...) 0 0 / auto repeat scroll}

into

a{background:url(...)}

Same applies to font, animation, and transition.

@Venemo
Copy link
Contributor

Venemo commented Nov 20, 2013

What happens if all the values of a shorthand are defaults?
For example,

foo{background:transparent none repeat 0 0 scroll}

Is this the shortest possible form of it?

foo{background:none}

Or is there something even shorter that's still valid?

@Venemo
Copy link
Contributor

Venemo commented Nov 20, 2013

Okay, maybe this is even shorter and still valid:

foo{background:0 0}

But according to W3C this is NOT equivalent to

foo{background:0}

Because when only one unit is specified for background-position the second value is treated as 50%.

@GoalSmashers
Copy link
Contributor Author

It indeed should be :0 0 - please see https://github.com/GoalSmashers/clean-css/blob/master/lib/clean.js#L241

@Venemo
Copy link
Contributor

Venemo commented Dec 22, 2013

@GoalSmashers I've just noticed something: seems that for whatever reason, the property optimizer is not called when there's only one property - which means it can't perform this optimalization when there's only one property. I'm now looking into fixing this. Do you have an idea?

@GoalSmashers
Copy link
Contributor Author

@Venemo
Copy link
Contributor

Venemo commented Dec 22, 2013

@GoalSmashers Yes, that's it! Thanks!

@GoalSmashers
Copy link
Contributor Author

Fixed with #249.

@GoalSmashers GoalSmashers modified the milestones: 2.2, 2.3 Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants