Sort the CSS files by what they are for - #50
Merged
Conversation
The root css/ directory held one file and gave no clue whose it was. The two stylesheets in this repository turned out to serve unrelated purposes, and neither belonged where it was. code-blocks.css styles pre, pre > code and .copy-button on documentation pages. Nothing in src/ references it -- .copy-button comes from src/copyToClipboard.js, which is not a component. But it is not this project's file either: caltechlibrary/caltechlibrary.github.io owns it and serves it at /css/code-blocks.css, byte-identical to the copy here, next to site.css which the template already loads. So it is deleted rather than moved, and the template loads the org copy with a root-relative href. Root-relative rather than relative because a template renders pages at any depth; build-pandoc happens to emit everything flat today, which made the relative form correct by accident. textarea-agent-list.css is component CSS. css-href is a documented feature of textarea-agent-list and textarea-csv, letting a consumer replace the component's styling, and this is the default for the former. It was reachable by nobody: publish_to_s3.bash uploads root *.js and css/*.css but not root *.css, so it returned 404 on both hosts. It moves to src/, beside the component it belongs to and matching its name, and deno task build now copies src/*.css into dist/ so it publishes with everything else. Root css/ no longer exists, so sources: in the publish workflow can drop it and upload dist alone.
t4k
force-pushed
the
cleanup/sort-css-by-purpose
branch
from
September 2, 2026 17:49
00b03f7 to
cd88560
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The root
css/directory held one file and gave no clue whose it was. The twostylesheets here serve unrelated purposes, and neither belonged where it was.
code-blocks.cssbelongs to the shared themeIt styles
pre,pre > codeand.copy-buttonon documentation pages.Nothing in
src/references it —.copy-buttoncomes fromsrc/copyToClipboard.js, which is not a component: nocustomElements.define,not exported from
mod.js.It is part of the Pandoc theme, so
caltechlibrary/workflowsshould own it andship it into every site it builds, alongside the template that asks for it.
That change is in progress. This repository does not need a copy either way, so
it is deleted here.
Interim state, stated plainly: until this repository adopts the shared
template (#51), its own
pandoc/page.tmplloads the stylesheet from/css/code-blocks.css— the copy the organization site serves at the domainroot, byte-identical to the one deleted here. That is a dependency we intend to
remove, not endorse; it replaces the current dependency on a stale S3 copy,
so it is an improvement in the meantime.
Root-relative, not relative. A template renders pages at any depth, so a
relative
hrefis only correct if every page sits at the output root.build-pandochappens to emit everything flat today, which would have made arelative href correct by accident.
/css/code-blocks.cssmatches the assumptionthe template already makes with
<a href="/">All Library Apps</a>.Note the asymmetry:
copyToClipboard.jshas no copy anywhere but the S3 CDN, soit stays referenced there until the theme change lands.
textarea-agent-list.cssis component CSS, and was unreachablecss-hrefis a documented consumer feature ontextarea-agent-listandtextarea-csv— it injects a<link>into the shadow root so a consumer canreplace the component’s styling. This file is the default for the former: it
styles
ul/li, exactly what the component renders.It was published nowhere:
publish_to_s3.bashuploads root*.jsandcss/*.css, but not root*.css.A documented feature had no default to point at.
It moves to
src/textarea-agent-list.css, next to the component and matchingits name, and
deno task buildgains acopy-cssstep puttingsrc/*.cssintodist/. It publishes flat, alongside the component:docs/textarea-agent-list.mdnow states that URL.Follow-on
Root
css/no longer exists, sosources:in the publish workflow drops todistalone. Two things briefly go stale until that branch lands:publish_to_s3.bash:165globscss/*.cssand will match nothing, anddocs/DEPLOYMENT.md:116describes that behaviour. Both are deleted or rewrittenby the publish change; nothing has run that script since July 2025.