Skip to content

Added 'transparent' as a named color#800

Merged
sashasklar merged 1 commit intoless:masterfrom
SpadarShut:master
May 15, 2012
Merged

Added 'transparent' as a named color#800
sashasklar merged 1 commit intoless:masterfrom
SpadarShut:master

Conversation

@SpadarShut
Copy link
Copy Markdown
Contributor

No description provided.

@sashasklar
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

@lukeapage
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

this causes problems when using background shorthand:

background: transparent url(/proxy?url=https%3A%2F%2Fgithub.com%2Fimages%2Fsidebar_icons.png) 32px 1px no-repeat;

is compiled to:

background: #NaNbbaaNaN00NaN00NaN00NaN00NaN url(/proxy?url=https%3A%2F%2Fgithub.com%2Fimages%2Fsidebar_icons.png) 32px 1px no-repeat;

I'm compiling using node v0.6.17

@SpadarShut
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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