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

CSS tidyup, Table glitch fix, sticky "Newer version" banner #169

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

osfameron
Copy link
Contributor

@osfameron osfameron commented Jul 31, 2023

Some reorg work I did while trying to get head around our CSS.
As I want to use this as basis for future work, this branch does now also include 2 features:

NB: this second fix does use dynamic css variables, which means:

  • we have to disable a postcss plugin…
  • … which may impact time-to-first-paint or other metrics, to be monitored
  • … and will cause some breakage potentially on obsolete browsers like IE11
  • … and might have other subtle behaviours from the css variables now being dynamic instead of static

(I think it's worth pushing in any case, and fixing issues as we come across them, but happy to hear concerns, or for 👀 to point out any concrete issues with the implementation!)

Copy link
Contributor

@sarahlwelton sarahlwelton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple questions :)

.mb-lg-5 {
margin-bottom: var(--base-large-space) !important; /* 32px */
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious why we deleted all of this spacing CSS?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find any evidence of it being used.
It looks like tailwindCSS convention, which isn't used elsewhere in the project, so I think it's an experiment that wasn't furthered.

Comment on lines -512 to -524
/* Use this for a working pseudo element before an [abstract] attribute-marked block in the documentation.
This one adds the words "Quick Summary" before any text inside the [abstract] block. */

/*
.doc .abstract blockquote::before {
content: "Quick Summary \a";
white-space: pre;
color: var(--color-muted);
font-weight: var(--weight-medium);
font-size: var(--heading-h4);
padding-bottom: 1rem;
} */

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You asked me to leave this in, in case we wanted to use it as a working example of a Pseudo :before in the future :) Sure you want to delete it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hahaha, good catch.
(Trying to purge commented CSS as it adds to cognitive weight, but will have a think...)

@@ -208,7 +200,7 @@
}

.navbar-dropdown li.current a.navbar-item::before {
content: "\2023";
content: "\2023"; /* ‣ */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to have a special character like that in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure, inside a comment.
(I suspect it'd be fine inside the quotes too, but haven't tested extensively...)

@@ -129,3 +117,57 @@
.toc ul li[data-level="2"] a {
padding-top: 2px;
}

/* Sidebar Box and Tools */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for the Redocly integration, or?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this PR is intended to be a refactor, so it's just decribing the existing sidebar box.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're just tidying up at the moment, but this file still contains the problematic table caption styles?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, this PR is a refactor and shouldn't contain any new features (and with a bit of luck, no new breakage either... 😅)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(NB: now not true, see the most recent commits)

It's nice to credit contributors...
but doing so in an invisible div that makes an API request
to Github on every page load perhaps not.
Refactor callouts.css

base.css - document, purge tailwind

css-tidyup

Comments.
Merge toc.css and toolbar.css

css-tidyup minor components
Glitch reported by @malarky.
Removed special display/position handling.
Make article-banner ("A newer version of this document is available")
sticky.
This requires updating the scroll-top, otherwise when clicking on a link
it would be hidden behind the banner.
The existing handling already accounts for the same issue, but with the
height (7.1rem) of the top nav.
We use a dynamic css `var(--scroll-margin-top-space)` which can be
overridden in the case that we have a banner.
@osfameron osfameron changed the title CSS tidyup CSS tidyup, Table glitch fix, sticky "Newer version" banner Aug 8, 2023
@@ -5,7 +5,6 @@
{{> labels}}
</div>
{{/if}}
{{> contributor-bot}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was contributor-bot? Why are we deleting it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go to e.g. view-source:https://docs.couchbase.com/server/current/getting-started/do-a-quick-install.html and you'll see <div class="contributor-list-box">
Inspect the DOM and you'll see it's been filled with

<ul id="contributorList"><li><a href="https://github.com/mojavelinux" target="_blank"><img src="https://avatars.githubusercontent.com/u/79351?v=4" alt=""></a></li><li><a href="https://github.com/cb-docs-robot" target="_blank"><img src="https://avatars.githubusercontent.com/u/25054062?v=4" alt=""></a></li><li><a href="https://github.com/anmol-algo" target="_blank"><img src="https://avatars.githubusercontent.com/u/58175473?v=4" alt=""></a></li><li><a href="https://github.com/RayOffiah" target="_blank"><img src="https://avatars.githubusercontent.com/u/77050471?v=4" alt=""></a></li><li><a href="https://github.com/amarantha-k" target="_blank"><img src="https://avatars.githubusercontent.com/u/13425257?v=4" alt=""></a></li></ul>

e.g. it's doing an API request to github stats for docs-ui on every page load to fill this in.

@osfameron osfameron marked this pull request as draft April 4, 2024 13:26
@osfameron
Copy link
Contributor Author

(Left too long unmerged, will have to come back to this to see if there's anything that can be introduced -- as smaller PRs...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants