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

fix: list spacing #351

Merged
merged 2 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 33 additions & 4 deletions packages/example/src/pages/components/markdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,55 @@ Strikethrough uses two tildes. ~~Scratch this.~~

## Lists

**Unordered lists**

- Unordered list can use asterisks
- Or hyphens to create list items
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
- dolore magna aliqua. Pharetra massa massa ultricies mi quis. Adipiscing enim eu turpis egestas pretium aenean.
- Massa eget egestas purus viverra accumsan in nisl nisi.
- Dolor sit amet consectetur adipiscing elit pellentesque habitant morbi tristique.

**Ordered lists**

1. First ordered list item
2. Item with a nested item
1. Nested list item
3. In markdown, the actual numbers don't matter, just that it's a number
4. In markdown, the actual numbers don't matter, just that it's a number

**Nested lists**

- Unordered list can use asterisks
- Nested list item
- Or hyphens to create list items

#### Code

```markdown src=https://github.com/carbon-design-system/gatsby-theme-carbon/tree/master/packages/gatsby-theme-carbon/src/components/markdown
- Unordered list can use asterisks

* Or hyphens to create list items

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
- dolore magna aliqua. Pharetra massa massa ultricies mi quis. Adipiscing enim eu turpis egestas pretium aenean.
- Massa eget egestas purus viverra accumsan in nisl nisi.
- Dolor sit amet consectetur adipiscing elit pellentesque habitant morbi tristique.
```

```markdown src=https://github.com/carbon-design-system/gatsby-theme-carbon/tree/master/packages/gatsby-theme-carbon/src/components/markdown
1. First ordered list item
2. Item with a nested item
1. Nested list item
3. In markdown, the actual numbers don't matter, just that it's a number
4. In markdown, the actual numbers don't matter, just that it's a number
```

```markdown src=https://github.com/carbon-design-system/gatsby-theme-carbon/tree/master/packages/gatsby-theme-carbon/src/components/markdown
1. First ordered list item
1. Item with a nested item
1. Nested list item
1. In markdown, the actual numbers don't matter, just that it's a number

- Unordered list can use asterisks

* Or hyphens to create list items
```

## Links
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,16 @@
.h6,
.list {
width: 100%;

@include carbon--breakpoint('md') {
width: 75%;
}

@include carbon--breakpoint('lg') {
width: 66.667%;
}
}

:global(.bx--list--ordered).list,
:global(.bx--list--unordered).list {
margin-bottom: $spacing-06;
}

.list-item {
@include carbon--type-style('body-long-02');
padding-right: 0;
margin: 0;
margin-bottom: $spacing-05;
width: 100%;
}

// responsive items in a list need to be full width
.list-item .paragraph,
.list-item :global(.bx--row) {
Expand All @@ -82,6 +71,22 @@
}
}

//---------------------------------------
// List items / ol / ul / li
//---------------------------------------

:global(.bx--list--ordered).list,
:global(.bx--list--unordered).list {
margin-bottom: $spacing-06;
}

.list-item {
@include carbon--type-style('body-long-02');
padding-right: 0;
margin: 0;
width: 100%;
}

//---------------------------------------
// Blockquote
//---------------------------------------
Expand Down