question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

<hr> style in DocumentWrapper and DocumentFormatting renders invisible

See original GitHub issue

Describe the bug The styles applied to <hr> tags in DocumentWrapper and DocumentFormatting cause the element to render invisible. See https://github.com/storybookjs/storybook/blob/master/lib/components/src/typography/DocumentFormatting.tsx#L181:

    hr {
      border: 0 none;
      color: ${props.theme.appBorderColor};
      height: 4px;
      padding: 0;
    }

Applying border: 0 none with any color results in nothing being displayed since a horizontal rule has no content and only the border is shown.

This should likely be setting border-top instead, similar to what is done in theming https://github.com/storybookjs/storybook/blob/master/lib/theming/src/global.ts#L109:

      hr: {
        ...resetStyles.hr,
        borderTop: `1px solid ${color.border}`,
      },

To Reproduce This occurs when using the notes addon if the story’s notes contains <hr> or --- in markdown. This likely also occurs anywhere else DocumentWrapping or DocumentFormatter is used.

Expected behavior Horizontal rules should be rendered with the theme’s border color.

I’ll be happy to open a PR for this but please let me know if I’ve missed something and the current behavior actually is expected.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dsusskindcommented, Nov 5, 2019

I was ambitious in closing this, realized it should probably stay open until the fix actually gets released

1reaction
dsusskindcommented, Nov 4, 2019

Hey @shilman and @domyen, I have a PR open for this: #8659. I added <hr> and --- elements to a few examples in official-storybook. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

make <hr> tag invisible in IE6? - css
So to answer your question... no... there isn't a way to get rid of the border on <hr> element in IE6 without a...
Read more >
Everything about `<hr>`: When to use it and how to style it
Browsers render <hr> as a horizontal rule by default. W3Schools (2021a) offers the CSS code that most browsers use as their default style:....
Read more >
<hr>: The Thematic Break (Horizontal Rule) element - HTML
The <hr> HTML element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift...
Read more >
Microsoft Outlook 2016 not rendering <hr> tags (horizontal
I recently found that the horizontal lines tags are not rendering in MS ... <hr style="background: #d9d9d9; border: none; color: #d9d9d9; ...
Read more >
How to make an hr invisible
I wanted to have a separation between sibling elements on my HTML page. One idea I had was to wrap them in section...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found