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

chore(curriculum): add styling for pdf download banner #11834

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
31 changes: 31 additions & 0 deletions client/src/curriculum/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@mixin note {
background-color: var(--curriculum-bg-color-note);
border: 0;
border-radius: var(--elem-radius);
margin: 1rem;
padding: 1rem;

ol,
ul {
padding-left: 1rem;

li:last-child {
margin-bottom: 0;
}
}

ol,
ul,
p {
margin-top: 0.5rem;
}

> p:first-child {
// The "Notes:" paragraph.
margin-top: 0;
}

> :last-child {
margin-bottom: 0;
}
}
18 changes: 18 additions & 0 deletions client/src/curriculum/about.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@use "../ui/vars" as *;
@use "mixins" as curriculum;
@use "../ui/atoms/button/mixins" as button;

.curriculum-content-container.curriculum-about {
.curriculum-content {
// Workaround so last toc item works.
Expand Down Expand Up @@ -40,5 +44,19 @@
content: var(--curriculum-about-not);
}
}

h3#educators + .section-content blockquote:not(.curriculum-notes) {
// PDF download banner

@include curriculum.note;

> p:last-child {
text-align: center;

a:only-child {
@include button.secondary;
}
}
}
}
}
31 changes: 2 additions & 29 deletions client/src/curriculum/index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "../ui/vars" as *;
@use "mixins" as curriculum;

.curriculum {
--background-toc-active: var(--curriculum-bg-color);
Expand Down Expand Up @@ -227,35 +228,7 @@
}

blockquote.curriculum-notes {
background-color: var(--curriculum-bg-color-note);
border: 0;
border-radius: var(--elem-radius);
margin: 1rem;
padding: 1rem;

ol,
ul {
padding-left: 1rem;

li:last-child {
margin-bottom: 0;
}
}

ol,
ul,
p {
margin-top: 0.5rem;
}

> p:first-child {
// The "Notes:" paragraph.
margin-top: 0;
}

> :last-child {
margin-bottom: 0;
}
@include curriculum.note;
}

p.curriculum-outcomes {
Expand Down
49 changes: 49 additions & 0 deletions client/src/ui/atoms/button/_mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@mixin _button {
--button-font: var(--type-emphasis-m);
--button-padding: 0.43rem 1rem;
--button-radius: var(--elem-radius, 0.25rem);

background-color: var(--button-bg);
border: 1px solid var(--button-border-color);
border-radius: var(--button-radius);
color: var(--button-color);
display: inline-block;
font: var(--button-font);
letter-spacing: normal;
padding: var(--button-padding);
text-align: center;
text-decoration: none;

&.external:after {
display: none;
}

&:hover {
--button-border-color: var(--button-bg-hover);
--button-bg: var(--button-bg-hover);
}

&:active {
--button-bg: var(--button-bg-active);
}
}

@mixin primary {
--button-bg: var(--button-primary-default);
--button-bg-hover: var(--button-primary-hover);
--button-bg-active: var(--button-primary-active);
--button-border-color: var(--button-primary-default);
--button-color: var(--background-primary);

@include _button;
}

@mixin secondary {
--button-bg: var(--button-secondary-default);
--button-bg-hover: var(--button-secondary-hover);
--button-bg-active: var(--button-secondary-active);
--button-border-color: var(--border-primary);
--button-color: var(--text-secondary);

@include _button;
}
Loading