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

Added 'transparent' as a named color #800

Merged
merged 1 commit into from
May 15, 2012
Merged

Added 'transparent' as a named color #800

merged 1 commit into from
May 15, 2012

Conversation

SpadarShut
Copy link
Contributor

No description provided.

@sashasklar
Copy link
Contributor

lgtm

sashasklar added a commit that referenced this pull request May 15, 2012
Added 'transparent' as a named color
@sashasklar sashasklar merged commit 8774a43 into less:master May 15, 2012
@lukeapage
Copy link
Member

@sashasklar and @SpadarShut - won't this mean that transparent is converted to rgba(0,0,0,0) ? But it seems rgba(0,0,0,0) has less support than the transparent keyword.. what problem is this trying to solve?

@SpadarShut
Copy link
Contributor Author

Color functions don't work when one of the colors is transparent.

@lukeapage
Copy link
Member

Ok, what do you think.. shouldn't less attempt to convert rgba(0,0,0,0) back to "transparent" when rendering ?

@SpadarShut
Copy link
Contributor Author

I think less should not convert all rgba(0,0,0,0), transparent should remain transparent where authors specified it, but transparent should become rgba(0,0,0,0) when it's procecced to produce another color.

@jasonkeene
Copy link

this causes problems when using background shorthand:

background: transparent url(/images/sidebar_icons.png) 32px 1px no-repeat;

is compiled to:

background: #NaNbbaaNaN00NaN00NaN00NaN00NaN url(/images/sidebar_icons.png) 32px 1px no-repeat;

I'm compiling using node v0.6.17

@SpadarShut
Copy link
Contributor Author

I guess that's because the named colors are processed from HEX notation, but rgba() is the only exception from the list.

@lukeapage
Copy link
Member

And even if you fix that, it will only keep a transparent keyword in simple rules (less.js uses a catch all regex when possible on rules), any place where it has to be parsed it will be converted to rgba. Untill less.js records the initial format of colors, it would be safer to convert rgba(0,0,0,0) to transparent.

@matthew-dean
Copy link
Member

rgba(0,0,0,0) has no support in IE6 / 7 / 8 so I hope that this doesn't change all "transparent" keywords to rgba.

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

Successfully merging this pull request may close these issues.

5 participants