Skip to content
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@fortawesome/free-solid-svg-icons": "^6.3.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@openstax/experiments": "^1.0.2",
"@openstax/flex-page-renderer": "https://github.com/openstax/flex-pages.git#renderer-1.1.0",
"@openstax/flex-page-renderer": "https://github.com/openstax/flex-pages.git#renderer-1.1.4",
"@sentry/integrations": "^7.114.0",
"@sentry/react": "^9.16.1",
"@types/react-modal": "^3.16.3",
Expand Down Expand Up @@ -91,7 +91,7 @@
"node-localstorage": "^2.2.1",
"node-sass": "^8.0.0",
"particles.js": "^2.0.0",
"pattern-library": "openstax/pattern-library",
"pattern-library": "openstax/pattern-library#semver:^1.5.0",
"preact": "~10.24",
"prettier": "^3",
"react-modal": "^3.16.1",
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/book-selector/book-selector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
overflow: hidden;

.subject-toggle {
@include button-reset();

align-items: center;
background: none;
border: 0;
Expand Down
6 changes: 6 additions & 0 deletions src/app/components/carousel/carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
max-width: calc(100vw - 3rem);

.frame-changer {
@include button-reset();

align-items: center;
background-color: rgba(ui-color(black), 0.4);
color: ui-color(white);
display: flex;
font-size: inherit;
font-weight: 500;
height: 7rem;
justify-content: center;
min-width: 4rem;
padding: 1rem;
position: absolute;
top: 50%;
transform: translateY(-50%);
Expand Down
2 changes: 2 additions & 0 deletions src/app/components/dialog/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ dialog,

.put-away {
@include body-font(3.6rem);
@include button-reset();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The next two lines can be removed, as they're redundant with button-reset now, right?

background-color: transparent;
border: 0;
box-shadow: none;
Expand Down
41 changes: 41 additions & 0 deletions src/app/components/jsx-helpers/raw-html.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@import 'pattern-library/core/pattern-library/headers';

// Styles for CMS-authored markup rendered by the adjacent <RawHTML> component,
// whose container is tagged `.cms-content`. Buttons authored in CMS rich-text
// render through it. The base button plus the variant classes editors use
// (`btn-orange`, `cta`, `btn-cyan`, `btn-gold`, `btn-large`) are built from the
// pattern-library button mixins and scoped to that container, so they apply
// only to editor content and never globally.
.cms-content {
button,
.btn {
@include button();
}

.btn-large {
padding: 2.5rem;
}

// Call-to-action buttons generally have this style
.cta > .btn {
padding: 1.5rem 2rem;
text-transform: uppercase;
}

.cta > .btn,
.btn-orange {
@include button-type-specific(primary);
}

.btn-cyan {
background-color: os-color(light-blue);
border: 0;
color: ui-color(white);
}

.btn-gold {
background-color: os-color(gold);
border: 0;
color: ui-color(white);
}
}
8 changes: 7 additions & 1 deletion src/app/components/jsx-helpers/raw-html.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React from 'react';
import cn from 'classnames';
import usePortalContext from '~/contexts/portal';
import './raw-html.scss';

// Making scripts work, per https://stackoverflow.com/a/47614491/392102
function activateScripts(el: HTMLElement) {
Expand Down Expand Up @@ -45,6 +47,7 @@ export default function RawHTML({
Tag = 'div',
html = '',
embed = false,
className,
...otherProps
}: RawHTMLArgs) {
const ref = React.useRef<HTMLElement>();
Expand All @@ -60,6 +63,9 @@ export default function RawHTML({
return React.createElement(Tag, {
ref,
dangerouslySetInnerHTML: {__html: html},
...otherProps
...otherProps,
// Tag all CMS-authored markup with `cms-content` so styles for editor
// content (e.g. buttons) can target it specifically.
className: cn('cms-content', className)
});
}
2 changes: 2 additions & 0 deletions src/app/components/more-fewer/more-fewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
grid-row-gap: 2rem;

[role="button"] {
@include focus-indicator();

cursor: pointer;
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/components/multiselect/book-tags/book-tags.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
padding: 0 1rem;

.put-away {
@include button-reset();

font-size: inherit;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/search-bar/search-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
}

.clear-search {
@include button-reset();

grid-column: 1;
grid-row: 1;
justify-self: end;
Expand All @@ -57,7 +59,7 @@
width: 100%;

&:focus-within {
outline: 0.2 solid ui-color(focus-outline);
@include focus-style();
}

.floating-label {
Expand Down
1 change: 1 addition & 0 deletions src/app/components/student-form/student-form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

.cta .btn {
@include button();
@include button-type-specific(primary);
margin: 2rem auto;
text-transform: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
.dropdown {
position: relative;

// The dropdown toggle is an `<a role="button">`, so it carries the ring itself.
> a[role="button"] {
@include focus-indicator();
}

// Keeps rightmost menu from hanging off the screen
&.rightmost .dropdown-container {
right: -1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ $button-size: 1.6rem;
top: 0;
}

&:hover,
&:focus,
&:active {
outline: none;
}
@include button-reset();

span {
// create middle line
Expand Down
2 changes: 2 additions & 0 deletions src/app/layouts/default/header/sticky-note/sticky-note.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
}

.put-away {
@include button-reset();

align-items: center;
align-self: flex-end;
display: flex;
Expand Down
1 change: 1 addition & 0 deletions src/app/layouts/default/shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#lower-sticky-note .put-away,
#microsurvey .put-away {
@include body-font(1.4rem);
@include button-reset();

background-color: rgba(ui-color(black), 0.56);
border-radius: 0.3rem;
Expand Down
2 changes: 2 additions & 0 deletions src/app/layouts/landing/footer/flex.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
}

button {
@include button-reset();

background-color: transparent;
color: inherit;
display: inline;
Expand Down
4 changes: 4 additions & 0 deletions src/app/pages/ally-logos/ally-logos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
.url {
padding: 0.5rem 0 0.5rem 1rem;
}

button {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These (/ally-logos, the copy buttons) lost padding and foreground/background color.

@include button-reset();
}
}

.boxed.smaller-icon img {
Expand Down
6 changes: 6 additions & 0 deletions src/app/pages/assignable/sections/cta/cta.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,10 @@
.primary {
@extend %primary;
}

// CTA buttons are large and uppercased.
.btn {
padding: 1.5rem 2rem;
text-transform: uppercase;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The "Let us know" button was previously not uppercase. Is this a design change or the Assignable page?

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@
}
}

.show-toc {
@include focus-indicator();
}

.options {
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ $extra-dark-mask: rgba(0, 0, 0, 0.4);
}

.put-away {
@include button-reset();

background-color: text-color(link);
background-blend-mode: multiply;
background-image: linear-gradient(to bottom, $darkening-mask, $darkening-mask);
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/details/details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ $gradient-sequence: ui-color(white), ui-color(white) 50%, transparent;
}

.close-toc {
@include focus-indicator();

align-items: center;
border-radius: 50%;
cursor: pointer;
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/errata-form/form/FileUploader.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

@mixin file-button() {
align-items: center;
display: grid;
Expand All @@ -13,6 +14,8 @@
}

.clear-file {
@include button-reset();

appearance: none;
background-color: inherit;
color: inherit;
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/k12/k12-main/testimonial.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
padding: 5rem $normal-margin 7rem;

button {
@include button-reset();

appearance: auto;
background-color: ui-color(white);
width: 1rem;
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/partners/active-filters/active-filters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
}

button {
@include button-reset();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

again the next two lines could be removed

appearance: none;
background-color: transparent;
color: text-color(normal);
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/partners/mobile-controls/mobile-controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
top: 0;

.put-away {
@include button-reset();

font-size: 3rem;
font-weight: normal;
transform: translateY(-0.5rem);
Expand Down
2 changes: 2 additions & 0 deletions src/app/pages/partners/partners.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
}

.put-away {
@include button-reset();

background-color: inherit;
color: inherit;
margin-left: $normal-margin;
Expand Down
12 changes: 5 additions & 7 deletions src/app/pages/research/components/members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ export const MembersSection = ({
/>
))}
</MemberGrid>
<p
className="py-4 mobile-only"
role="button"
<button
type="button"
className="mobile-only view-all-toggle"
aria-expanded={viewAll}
aria-controls="member-grid"
onClick={() => {
Expand All @@ -115,17 +115,15 @@ export const MembersSection = ({
setViewAll(!viewAll);
}}
css={{
cursor: 'pointer',
color: colors.linkText,
textAlign: 'center'
color: colors.linkText
}}
>
<FontAwesomeIcon
icon={viewAll ? faChevronUp : faChevronDown}
></FontAwesomeIcon>
&nbsp;
{viewAll ? 'View Less' : 'View All Current Members'}
</p>
</button>
</div>
{/* @ts-expect-error-next-line label is not a known attribute */}
<div label="Collaborating Researchers">
Expand Down
9 changes: 4 additions & 5 deletions src/app/pages/research/components/publications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,18 @@ export const Publications = ({
{publicationList.map((publication, index) => (
<PublicationItem key={index} publication={publication} />
))}
<span
role="button"
<button
type="button"
aria-expanded={viewAll}
aria-controls="publication-list"
className="py-4"
className="view-all-toggle"
onClick={() => {
if (viewAll) {
scrollToPublications();
}
setViewAll(!viewAll);
}}
css={{
cursor: 'pointer',
color: colors.linkText,
alignSelf: 'center'
}}
Expand All @@ -67,7 +66,7 @@ export const Publications = ({
/>
&nbsp;
{viewAll ? 'View Less' : 'View All Publications'}
</span>
</button>
</Box>
</Section>
);
Expand Down
Loading
Loading