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

Removed margins from ul ul #10

Closed
wants to merge 1 commit into from
Closed

Removed margins from ul ul #10

wants to merge 1 commit into from

Conversation

LimeBlast
Copy link

Much like with my other pull request, I could be barking up the wrong tree here, but I figured, for code such as the example below, this would prevent huge, unneeded, margins on each of the inner lists:

<ul>
    <li>TV Series
        <ul>
            <li>TV Series DVD</li>
            <li>TV Series Bluray</li>
        </ul>
    </li>
    <li>Movies
        <ul>
            <li>DVD Movies</li>
            <li>Bluray Movies</li>
        </ul>
    </li>
    <li>Games
        <ul>
            <li>PC
                <ul>
                    <li>Download from Steam</li>
                    <li>Physical Media</li>
                </ul>
            </li>
            <li>Xbox 360</li>
            <li>Playstation 3</li>
        </ul>
    </li>
</ul>

(Or maybe this should be submitted to the original normalize.css project, I don't know)

@oli
Copy link

oli commented May 24, 2013

@LimeBlast out of curiosity, are you seeing this problem in actual browsers? I ask because afaik all user agent stylesheets already have default rules for preventing this. If you plan to do this in a non-Normalize project, using li ul, li ol {…} would also work better for you.

HTH

@LimeBlast
Copy link
Author

Using this stylesheet, yes it is, because the upper and lower margin are specifically set, without removing them from nested lists.

@oli
Copy link

oli commented May 24, 2013

@LimeBlast Have you tested this? If so, what browser are you seeing this in? User agent stylesheet rules for nesting should have greater specificity than the rules in Normalize. For example Chrome has these rules:

ol ul, ul ol, ul ul, ol ol {
-webkit-margin-before: 0px;
-webkit-margin-after: 0px;
}

(They should use li ol, li ul too 😉)

@LimeBlast
Copy link
Author

Yes I tested it, that's how I knew it was a problem. I can't remember exactly which browsers, but most likely Firefox and/or Chrome.

@oli
Copy link

oli commented May 24, 2013

@LimeBlast My mistake, you’re right— this does override user agent styles. @JohnAlbin’s addition of vertical rhythm on #L341 is causing it. Interestingly it’s also visible in Normalize v1, where it’s intended behavior as per necolas#57.

@JohnAlbin
Copy link
Owner

This is related to #13.

@JohnAlbin JohnAlbin closed this in 4eb855b Jul 2, 2013
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