Skip to content

[Lists]: Simplify lists to use browser defaults#1375

Merged
msecret merged 6 commits into
stagingfrom
simplify-lists
Aug 4, 2016
Merged

[Lists]: Simplify lists to use browser defaults#1375
msecret merged 6 commits into
stagingfrom
simplify-lists

Conversation

@maya

@maya maya commented Aug 3, 2016

Copy link
Copy Markdown
Contributor

Description

Simplifies lists to use browser defaults, and not use on pseudo selectors.

Resolves: #1091.

Dependent on #1374 for sidenav to look correct.

Notable change is that we are switching styles, and bullets will look slightly larger depending on your browser default. Below is Chrome.

Screenshots

Before (custom list and bullets):
screen shot 2016-08-03 at 1 02 13 pm

After (Chrome browser default):
screen shot 2016-08-03 at 1 39 50 pm

Before you hit Submit, make sure you’ve done whichever of these applies to you:

  • Follow the 18F Front End Coding Style Guide and Accessibility Guide.
  • Run npm test and make sure the tests for the files you have changed have passed.
  • Run your code through HTML_CodeSniffer and make sure it’s error free.
  • Title your pull request using this format: [Website] - [UI component]: Brief statement describing what this pull request solves.


@mixin unstyled-list() {
display: block;
@include margin(0 null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this? I haven't seen this pattern before.

@maya maya Aug 3, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had margin: 0 before (https://github.com/18F/web-design-standards/pull/1375/files#diff-fced6c74fbf3140d02e92fd710e888eeL31), when actually the only margins added in the list was top and bottom. We do not need to declare margin=0 on the left and right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: it's not undoing our margins (we did not add any margins for uls), but webkits margins. You'll find:

-webkit-margin-before: 1em;
-webkit-margin-after: 1em;

applied to ul in the user agent styles. Which makes me think, should we add these in to be more explicit?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this rule will be expanded to:

margin-bottom: 0;
margin-top: 0;

I definitely don't think it's a good idea to mess with the webkit specific margin before rules. Those should be overridden with regular margin rules.

@maya maya Aug 4, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I wasn't suggesting adding -webkit-margin-before: 1em; ourselves. I meant should we add margin-bottom: 1em; ourselves, since webkit is already doing it + to make it more consistent across browsers. What do you think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 46a01a7. This will make it more consistent across browsers and match our paragraph text margins.

@msecret msecret merged commit bd6f4a1 into staging Aug 4, 2016
@maya maya deleted the simplify-lists branch August 24, 2016 00:07
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.

2 participants