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

Image replacement transparency needs importance #1144

Closed
wants to merge 1 commit into from

Conversation

barneycarroll
Copy link
Contributor

Currently the premature optimisation technique fails whenever the element would have color inherited or directly specified via a selector with more precedence than the single class .ir (almost all the time, in my experience). Seeing as we can't second guess authors' methods for defining colours, important is necessary.

Explained in more detail here: aa0396e#commitcomment-1591111

…requently inherited from superseding selectors.
@Inkdpixels
Copy link

Was also discussed here: #1108
Over the time i came to this point, and I think it covers pretty much every situation possible.

.ir {
    border: 0;
    font: 0/0 a !important;
    text-shadow: none !important;
    color: transparent !important;
    display: block;
    background-color: transparent;
}

On font: !important; - This will prevent that a dev would accidently set a higher font-size and break the layout, we could of course set overflow: hidden; - But thats not the cool way! See this testcase for reference http://jsfiddle.net/WTAhq/

@necolas
Copy link
Member

necolas commented Jul 29, 2012

Thanks. There is further work that need to be done on the IR technique and using !important where necessary will be part of that.

@necolas necolas closed this Jul 29, 2012
@necolas necolas mentioned this pull request Jul 29, 2012
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.

3 participants