~sircmpwn/sr.ht-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
5 3

[PATCH core.sr.ht] css: Make headings wrap, fix anchor alignment

Details
Message ID
<20210627161918.30680-1-umar@handlerug.me>
DKIM signature
pass
Download raw message
Patch: +3 -7
This commit also removes some unnecessary rules.
---
I haven't tested this beyond making the changes in Firefox DevTools,
sr.ht is quite hard to install locally. Tested on git.sr.ht pages.

 srht/scss/base.scss | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/srht/scss/base.scss b/srht/scss/base.scss
index 178b6af..f41620c 100644
--- a/srht/scss/base.scss
+++ b/srht/scss/base.scss
@@ -296,21 +296,17 @@ code {

  h1, h2, h3, h4, h5, h6 {
    position: relative;
    display: flex;
    margin-top: 1em;
    align-items: baseline;
    white-space: pre;

    &:first-child {
      margin-top: 0;
    }

    & > a:first-child {
      transition: opacity 0.15s linear;
      opacity: 0;
      position: absolute;
      font-size: inherit;
      left: -.7em;
      left: -1.4ch;
      opacity: 0;
      transition: opacity 0.15s linear;
    }

    @media(prefers-reduced-motion) {
-- 
2.32.0

[core.sr.ht/patches] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CCEJFPUBXGMZ.2860OU3DNO4WA@cirno>
In-Reply-To
<20210627161918.30680-1-umar@handlerug.me> (view parent)
DKIM signature
missing
Download raw message
core.sr.ht/patches: FAILED in 3m28s

[css: Make headings wrap, fix anchor alignment][0] from [handlerug][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/23493
[1]: umar@handlerug.me

✓ #533950 SUCCESS core.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/533950
✓ #533952 SUCCESS core.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/533952
✗ #533951 FAILED  core.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/533951

Re: [core.sr.ht/patches] build failed

Details
Message ID
<F8F9C706-D759-41A1-9791-3955B73B3AFF@nixnetmail.com>
In-Reply-To
<CCEJFPUBXGMZ.2860OU3DNO4WA@cirno> (view parent)
DKIM signature
pass
Download raw message
I think `position: relative` on h1..h6 can also be removed.

Re: [core.sr.ht/patches] build failed

Details
Message ID
<CCF4XACZ00BR.2Q0J1SYV21F2Q@lumine>
In-Reply-To
<F8F9C706-D759-41A1-9791-3955B73B3AFF@nixnetmail.com> (view parent)
DKIM signature
pass
Download raw message
`position: relative` is required on the parent element (`h1..h6`) to
make `position: absolute` on the child (`a`) work relatively to the
parent's position on the page. If you remove it, the anchor would have
an offset relative to the nearest parent with `position: relative` or
the page itself. There _is_ such an element (.col from Bootstrap), and
it has `position: relative` set, so it won't break right now. But that's
like planting a bomb with a timer — what if Sourcehut migrates away from
Bootstrap? Or the stylesheet will be used on a page without .col around
it? In my opinion, it's much more robust and reliable to set it
explicitly on the element you want to position things around.

Re: [core.sr.ht/patches] build failed

Details
Message ID
<FFC3001E-6952-4FEA-A9E2-B1E24CE2AF29@nixnetmail.com>
In-Reply-To
<CCEJFPUBXGMZ.2860OU3DNO4WA@cirno> (view parent)
DKIM signature
pass
Download raw message
You are right. I was totally stupid. I forgot how absolute positioning works. I should have thought when you said on IRC that removing this rule is hacky. But letter I found out why that works at this moment. IT IS A TIME BOMB.

Re: [core.sr.ht/patches] build failed

Details
Message ID
<CCF8A49IDKTN.2V2LIJXTFOU6H@lumine>
In-Reply-To
<FFC3001E-6952-4FEA-A9E2-B1E24CE2AF29@nixnetmail.com> (view parent)
DKIM signature
pass
Download raw message
(I've written the recent reply in order to clear things up, not to make
someone feel bad. I've actually figured out the real reason of using
relative positioning as I wrote the reply. If it did sound like I was
trying to look cool — I'm deeply sorry!)
Reply to thread Export thread (mbox)