cssremedy icon indicating copy to clipboard operation
cssremedy copied to clipboard

adjustments for <hr>

Open jensimmons opened this issue 6 years ago • 11 comments

From Reboot (Bootstrap's) and Normalize:

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */

hr {
  box-sizing: content-box; /* 1 */
  height: 0; /* 1 */
  overflow: visible; /* 2 */
}

Thoughts? We should test this.

jensimmons avatar Feb 12 '19 00:02 jensimmons

Yhup

JABClari avatar Feb 12 '19 15:02 JABClari

    1. Show the overflow in Edge and IE.

Chromium also has overflow: hidden.

pkra avatar Feb 12 '19 16:02 pkra

The beveled borders look not so great and dated. Adding a line like this might be nice?

border: .5px solid;

scottkellum avatar Feb 12 '19 16:02 scottkellum

Test: https://codepen.io/jensimmons/pen/Jxmdez By itself (link may expire): https://s.codepen.io/jensimmons/debug/Jxmdez

hr {border: .5px solid;} definitely looks much better.

jensimmons avatar Feb 14 '19 21:02 jensimmons

Why not set the border's width at 1px instead? Wouldn't that ensure it looks consistent in different browsers and operating systems? If pure black makes it too prominent, opacity could be lowered which would also make it look good on colored backgrounds.

hacknug avatar Feb 20 '19 12:02 hacknug

@hacknug .5px renders as 1px. It’s worth cross browser testing. I guess border-width: 1px 0 0; border-style: solid; would also work fine but it’s more verbose.

scottkellum avatar Mar 01 '19 22:03 scottkellum

I remember an issue I had when the iPhone X came out where half-pixel borders would render thicker on Safari Mobile than in other browsers. Didn't investigate it much since I didn't own such phone back then so maybe the issue was caused by something different than the ~@3x pixel density.

hacknug avatar Mar 03 '19 16:03 hacknug

Closing, as this has already been implemented. We can re-open if there's an issue with it.

mirisuzanne avatar Sep 05 '19 00:09 mirisuzanne

Based on @stacyk's PR comment and some testing, I think this needs a bit more conversation. From what I can tell:

  • for border width, 1px 0 0 gives us the same result with better legacy support and no real down-side
  • I can't find any reason to make an hr explicitly content-box? Why do we want that?
  • Firefox seems to be the only UA stylesheet that adds an explicit color: gray, so the other browsers inherit a color/border-color. Should that be consistent?

I guess I'm proposing:

hr {
  border-style: solid;
  border-width: 1px 0 0;
  color: inherit; 
  height: 0;
  overflow: visible;
}

mirisuzanne avatar Sep 10 '19 19:09 mirisuzanne

I want us to file an issue for Firefox to fix this intro bug:

Firefox seems to be the only UA stylesheet that adds an explicit color: gray, so the other browsers inherit a color/border-color. Should that be consistent?

jensimmons avatar Sep 15 '19 02:09 jensimmons

As an alternative to 1px how does border-width; thin; behave in older browsers? Nods to: https://www.chenhuijing.com/blog/about-subpxiel-rendering-in-browsers/

ollicle avatar Sep 15 '19 09:09 ollicle