# Numbers Cut-Off in Long List

**URL:** https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856
**Category:** Bug
**Created:** [24 مارس 2017، 5:44م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856 "2017-03-24T17:44:19Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Slowhand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slowhand/32/57436_2.png) [@Slowhand](https://meta.discourse.org/u/Slowhand)
#### Post date: [24 مارس 2017، 5:44م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/1 "2017-03-24T17:44:19Z")

</div>

I searched for quite a while and didn’t see anything about this.

We have several lists of episodes that go into 2- and 3-digits, and the left side of the numbers are cut off starting at about 20.

When you get to triple-digits, the entire first number is gone.

Is this something I can have an Admin adjust on our end?

> **Example of double digits**
>
> ![](https://global.discourse-cdn.com/meta/original/3X/4/4/44b2bb72c3db627c3868bd6ccd718e9d7ee859cc.png)

> **Example of triple digits**
>
> ![](https://global.discourse-cdn.com/meta/original/3X/a/4/a485b9237e8ac4c71645f2b02381cac1dab02557.png)

Thank you for any help you can give me.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [24 مارس 2017، 6:02م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/2 "2017-03-24T18:02:37Z")

</div>

هذه مشكلة في Discourse، ولا علاقة لها بموقعك.

انظر [https://try.discourse.org/t/testing-long-lists/708?u=jomaxro](https://try.discourse.org/t/testing-long-lists/708?u=jomaxro)

سأنتقل بهذا الموضوع إلى #contribute:bug، ما لم يرد الفريق أنه من الأفضل إبقاؤه في #Contribute > UX.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [25 مارس 2017، 1:15ص UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/3 "2017-03-25T01:15:22Z")

</div>

Just edit the relevant CSS as needed in Admin, Customize, CSS

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [27 مارس 2017، 4:10م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/4 "2017-03-27T16:10:18Z")

</div>

FYI the SCSS used:

```plaintext
.topic-body .contents {
    ul, ol, dd {
        margin-left: 40px;
    }
}

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [20 يوليو 2017، 12:23ص UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/5 "2017-07-20T00:23:23Z")

</div>

Let’s see, now that commonmark is here we can start with whatever number we like and it is easier to demo this

1. six-hundred-sixty-six

and

1. sixty-six

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [20 يوليو 2017، 12:41ص UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/6 "2017-07-20T00:41:21Z")

</div>

CSS is broken on mobile numbers are cut

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [20 يوليو 2017، 1:30ص UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/7 "2017-07-20T01:30:48Z")

</div>

I don’t know that we really need to allocate enough space for ten digit numbered lists.. I think allowing space for the digit one plus two more, should work, eg:

1. the number “122” should work

vs.

1. the number “9999” doesn’t need to

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [20 يوليو 2017، 4:03ص UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/8 "2017-07-20T04:03:54Z")

</div>

> [@codinghorror](#):
>
> I don’t know that we really need to allocate enough space for ten digit numbered lists.. I think allowing space for the digit one plus two more, should work, eg:  
> …  
> 9999. the number “9999” doesn’t need to

_Except_ that one of the cases I’ve run into this is starting a line with a four digit year.

July 20th in History.

1. The first Women’s Rights Convention in Seneca Falls, New York ends.

2. British Columbia joins Canada.

3. The first International Special Olympics Summer Games are held at Soldier Field in Chicago.

4. Apollo 11 lands, first humans on the Moon.

In the preview, your quoted “9999.” is shown in full, but my years cut off the first digit. In your post, I just see two digits of your “9999.”. Of course, since this thinks I’ve created an `<ol>`, all of the years after the first are trashed _anyway_.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [20 يوليو 2017، 10:24ص UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/9 "2017-07-20T10:24:18Z")

</div>

It seems to be due to this rule

```plaintext
ul, ol, dd {
    margin: 0 0 9px 25px;
    padding: 0;
}

```

If you comment that out, or “mark as it inactive in dev tools”, the list numbering just works, with any numbering.

It seems the `padding: 0` is the bigger culprit of that rule for causing issues.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [20 يوليو 2017، 1:46م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/10 "2017-07-20T13:46:40Z")

</div>

Can you do a few screenshots of before and after?

We might as just do a PR to clean up this CSS if there is no impact on the “before”

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [20 يوليو 2017، 1:53م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/11 "2017-07-20T13:53:04Z")

</div>

I’ll see what I can come up with. Might not be to later tonight though.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [20 يوليو 2017، 3:04م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/12 "2017-07-20T15:04:52Z")

</div>

## Before:

**User Menu:**

 ![](https://global.discourse-cdn.com/meta/original/3X/d/0/d0c797a714e90f2abc056c43c59791cb27e7687b.png)

**Homepage:**

 ![](https://global.discourse-cdn.com/meta/original/3X/9/3/93b5b1884d072ce14ae4ec5f8797effaccf5796a.png)

**Preview creating Topic:**

 ![](https://global.discourse-cdn.com/meta/original/3X/b/1/b18b076b8a0838a58639dfdc4971a8afe3ce880a.png)

**Cooked Topic with Unordered Lists, Ordered Lists and Definitions**

 ![](https://global.discourse-cdn.com/meta/original/3X/8/d/8dc51b912da15e3da83bb4b7cf039ce3fc3f7605.png)

* * *

## After

**User Menu:**

 ![](https://global.discourse-cdn.com/meta/original/3X/4/1/417460119bd6a4c32abc0d276c86339cd5b9ad08.png)

**Homepage:**

 ![](https://global.discourse-cdn.com/meta/original/3X/7/5/759403874fd318eb675a0e4c770b82bd483e2cbf.png)

**Preview/Editing Topic that was created:**

 ![](https://global.discourse-cdn.com/meta/original/3X/9/0/901b578f2c4589b2cce907686c37ccdf7b294ba9.png)

**Cooked Topic with Unordered Lists, Ordered Lists and Definitions**

 ![](https://global.discourse-cdn.com/meta/original/3X/f/c/fc4ea825f21f36f2519797ec84b3a4747d9cef1b.png)

* * *

### Just for Kicks and Giggles:

(no before captured)

**Preview Pane:**

 ![](https://global.discourse-cdn.com/meta/original/3X/d/1/d108bde9bdac8e6d54e1fa8bbbe5e11645c44bdc.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/2/4/2433ef5b87155e1dcd5a4d09690c25dd403214be.png)

**Cooked Version**

 ![](https://global.discourse-cdn.com/meta/original/3X/4/b/4b0cc0a5d8bc7def52a42bc46e526b74baa44d41.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/2/4/246a979612adf5b814448ee283e99b3190300429.png)

**Verdict:**  
The browser seems to use “safe” defaults for padding/margins to prevent ridiculous rendering? (tested in latest Chrome and IE 11 – because I had access to it)

I’ve yet to pin point why the preview shows 5 digits and cooked shows 4 when both have a padding of 40…

* * *

PR:  
[https://github.com/discourse/discourse/pull/4980](https://github.com/discourse/discourse/pull/4980)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [20 يوليو 2017، 3:19م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/13 "2017-07-20T15:19:03Z")

</div>

For those wondering, I took screenshots of the menus and homepage because they utilize `ol` for the category/tags drop down and wanted to show they were not impacted negatively by this change.

The User Menu probably doesn’t use it, but figured, might as well screenshot it too!

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [20 يوليو 2017، 3:36م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/14 "2017-07-20T15:36:37Z")

</div>

Here is a CodePen showing browsers cut off crazy long list numbers too (so it isn’t Discourse specific)

https://codepen.io/cpradio/embed/preview/xrvLpg?default-tabs=html%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=xrvLpg

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [20 يوليو 2017، 3:51م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/15 "2017-07-20T15:51:09Z")

</div>

> [@cpradio](#):
>
> I’ve yet to pin point why the preview shows 5 digits and cooked shows 4 when both have a padding of 40…

I know why this occurs now, the 5 is in the “overflow” boundary and the preview content is within another div that has a padding of 7px all around, thus the overflow of the 5 is able to be seen.

**Preview padding, showing the 5 in overflow.**

 ![](https://global.discourse-cdn.com/meta/original/3X/e/0/e0fa20556cdf3965d098ca8cf36cda4098f3d811.png)

**Cooked indicating no additional padding, thus no overflow shown**

 ![](https://global.discourse-cdn.com/meta/original/3X/4/d/4d6b513d2e60e5bdd460094796301ba2262a234d.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [25 يوليو 2017، 6:48م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/16 "2017-07-25T18:48:38Z")

</div>

OK, this now merged:

The indent for lists now is quite deep:

And not really consistent with indenting of bulleted lists, which does impact readability.

1. testing

- testing

1. testing

@awesomerobot can you have a quick to see if there is a CSS fix to improve this a bit?

If not, one options may be to place a class via the renderer on “big” lists.

Then we can use our old styling and add some additional rules for

`.ul.digits-2`  
`.ul.digits-3`

and so on.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [25 يوليو 2017، 8:40م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/17 "2017-07-25T20:40:19Z")

</div>

> [@sam](#):
>
> @awesomerobot can you have a quick to see if there is a CSS fix to improve this a bit?

The simple solution is to remove `ul` from the rule I removed `ol` from, that would make them both indented the same browser default amount.

I can submit such a PR fairly quickly (if you’d want to go that route)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [25 يوليو 2017، 9:38م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/18 "2017-07-25T21:38:57Z")

</div>

Sure go with that for now.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [25 يوليو 2017، 9:50م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/19 "2017-07-25T21:50:44Z")

</div>

K, I’ll get that done tonight. Let me go most of the endpoints of Discourse to make sure it doesn’t do anything crazy to the existing UI and I’ll get it submitted. 🙂

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [25 يوليو 2017، 10:25م UTC](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856/20 "2017-07-25T22:25:20Z")

</div>

Okay, had to approach it differently as doing the same fix for `ol` actually broke the main navigation.  
[https://github.com/discourse/discourse/pull/4999](https://github.com/discourse/discourse/pull/4999)

Before:

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/9/49b1fd2e29e84fca0981ee6d2c5dcc4683ec9f13.png)

After:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/8/2851753da246bc4a3ff55ef343c19e24660e5821.png)

[Next page](https://meta.discourse.org/t/numbers-cut-off-in-long-list/59856.md?page=2)
