Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions documentation/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,13 @@ const content = {
// Uses Docusaurus's own button classes rather than hand-rolled ones: they carry
// a readable foreground in both light and dark mode. A custom rule here had set
// the label to var(--ifm-background-color), which is #0000 in light mode -- so
// the text was transparent on a purple fill.
// the text was transparent on a purple fill. The primary button additionally
// takes a CSS-module class that recolours it to the StackGuardian icon blue by
// overriding the --ifm-button-* custom properties (see index.module.css).
function Action({label, to, href, primary}) {
const className = `button button--lg ${primary ? 'button--primary' : 'button--secondary'}`;
const className = primary
? `button button--lg button--primary ${styles.heroPrimary}`
: 'button button--lg button--secondary';
return to ? (
<Link className={className} to={to}>
{label}
Expand Down
19 changes: 19 additions & 0 deletions documentation/src/pages/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@
margin-top: 1.5rem;
}

/*
* The primary hero button uses the StackGuardian icon blue rather than the
* site primary. The icon's #007aff fails 4.5:1 against white (4.02:1), so the
* fill is the same hue darkened to #006ee6 (4.80:1), and darker again on
* hover. The label is pinned to opaque white because --ifm-button-color
* resolves differently per theme.
*/
.heroPrimary {
--ifm-button-background-color: #006ee6;
--ifm-button-border-color: #006ee6;
--ifm-button-color: #fff;
}

.heroPrimary:hover,
.heroPrimary:active {
--ifm-button-background-color: #0062cc;
--ifm-button-border-color: #0062cc;
}

@media screen and (max-width: 996px) {
.page {
padding: 2rem 1rem 3rem;
Expand Down
Loading