Commit b46deaf5 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner

Add and apply additional utility classes

parent 5d0b1028
...@@ -15,8 +15,8 @@ export default function AnnotationDocumentInfo({ annotation }) { ...@@ -15,8 +15,8 @@ export default function AnnotationDocumentInfo({ annotation }) {
} }
return ( return (
<div className="annotation-document-info"> <div className="annotation-document-info u-layout-row u-horizontal-rhythm">
<div className="annotation-document-info__title"> <div className="annotation-document-info__title u-color-text--muted">
on &quot; on &quot;
{documentInfo.titleLink ? ( {documentInfo.titleLink ? (
<a href={documentInfo.titleLink}>{documentInfo.titleText}</a> <a href={documentInfo.titleLink}>{documentInfo.titleText}</a>
...@@ -26,7 +26,7 @@ export default function AnnotationDocumentInfo({ annotation }) { ...@@ -26,7 +26,7 @@ export default function AnnotationDocumentInfo({ annotation }) {
&quot; &quot;
</div> </div>
{documentInfo.domain && ( {documentInfo.domain && (
<div className="annotation-document-info__domain"> <div className="annotation-document-info__domain u-color-text--muted">
({documentInfo.domain}) ({documentInfo.domain})
</div> </div>
)} )}
......
...@@ -80,7 +80,7 @@ export default function AnnotationHeader({ ...@@ -80,7 +80,7 @@ export default function AnnotationHeader({
)} )}
<span className="annotation-header__timestamp-created"> <span className="annotation-header__timestamp-created">
<Timestamp <Timestamp
className="annotation-header__timestamp-created-link" className="annotation-header__timestamp-created-link u-color-text--muted"
href={annotationLink} href={annotationLink}
timestamp={annotation.created} timestamp={annotation.created}
/> />
......
...@@ -9,7 +9,7 @@ export default function AnnotationLicense() { ...@@ -9,7 +9,7 @@ export default function AnnotationLicense() {
return ( return (
<div className="annotation-license"> <div className="annotation-license">
<a <a
className="annotation-license__link" className="annotation-license__link u-layout-row u-color-text--muted"
href="http://creativecommons.org/publicdomain/zero/1.0/" href="http://creativecommons.org/publicdomain/zero/1.0/"
title="View more information about the Creative Commons Public Domain dedication" title="View more information about the Creative Commons Public Domain dedication"
target="_blank" target="_blank"
......
...@@ -101,7 +101,7 @@ function AnnotationShareControl({ ...@@ -101,7 +101,7 @@ function AnnotationShareControl({
</div> </div>
</div> </div>
<div className="annotation-share-panel__content"> <div className="annotation-share-panel__content">
<div className="annotation-share-panel__input"> <div className="annotation-share-panel__input u-layout-row">
<input <input
aria-label="Use this URL to share this annotation" aria-label="Use this URL to share this annotation"
className="annotation-share-panel__form-input" className="annotation-share-panel__form-input"
......
...@@ -26,7 +26,7 @@ function AnnotationShareInfo({ annotation }) { ...@@ -26,7 +26,7 @@ function AnnotationShareInfo({ annotation }) {
); );
return ( return (
<div className="annotation-share-info"> <div className="annotation-share-info u-layout-row--align-baseline">
{linkToGroup && ( {linkToGroup && (
<a <a
className="annotation-share-info__group" className="annotation-share-info__group"
......
...@@ -123,7 +123,7 @@ function Annotation({ ...@@ -123,7 +123,7 @@ function Annotation({
)} )}
{isEditing && ( {isEditing && (
<div className="annotation__form-actions"> <div className="annotation__form-actions u-layout-row">
<AnnotationPublishControl <AnnotationPublishControl
annotation={annotation} annotation={annotation}
isDisabled={isEmpty} isDisabled={isEmpty}
...@@ -135,7 +135,7 @@ function Annotation({ ...@@ -135,7 +135,7 @@ function Annotation({
{!isCollapsedReply && ( {!isCollapsedReply && (
<footer className="annotation__footer"> <footer className="annotation__footer">
<div className="annotation__controls"> <div className="annotation__controls u-layout-row">
{shouldShowReplyToggle && ( {shouldShowReplyToggle && (
<Button <Button
className="annotation__reply-toggle" className="annotation__reply-toggle"
......
...@@ -27,7 +27,7 @@ function NewNoteButton({ annotationsService, settings }) { ...@@ -27,7 +27,7 @@ function NewNoteButton({ annotationsService, settings }) {
}; };
return ( return (
<div className="new-note-button"> <div className="u-layout-row--justify-right">
<Button <Button
buttonText="New note" buttonText="New note"
className="button--primary" className="button--primary"
......
...@@ -68,7 +68,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) { ...@@ -68,7 +68,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) {
<p>Use this link to share these annotations with anyone:</p> <p>Use this link to share these annotations with anyone:</p>
)} )}
</div> </div>
<div className="share-annotations-panel__input"> <div className="u-layout-row">
<input <input
aria-label="Use this URL to share these annotations" aria-label="Use this URL to share these annotations"
className="share-annotations-panel__form-input" className="share-annotations-panel__form-input"
...@@ -97,11 +97,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) { ...@@ -97,11 +97,7 @@ function ShareAnnotationsPanel({ analytics, toastMessenger }) {
)}{' '} )}{' '}
<span> <span>
Private ( Private (
<SvgIcon <SvgIcon name="lock" inline className="u-icon--inline" />{' '}
name="lock"
inline
className="share-annotations-panel__icon--inline"
/>{' '}
<em>Only Me</em>) annotations are only visible to you. <em>Only Me</em>) annotations are only visible to you.
</span> </span>
</p> </p>
......
...@@ -101,7 +101,7 @@ function TopBar({ ...@@ -101,7 +101,7 @@ function TopBar({
{!isSidebar && ( {!isSidebar && (
<div className="top-bar__inner content"> <div className="top-bar__inner content">
<StreamSearchInput /> <StreamSearchInput />
<div className="top-bar__expander" /> <div className="u-stretch" />
<Button <Button
className="top-bar__icon-button" className="top-bar__icon-button"
icon="help" icon="help"
...@@ -116,7 +116,7 @@ function TopBar({ ...@@ -116,7 +116,7 @@ function TopBar({
{isSidebar && ( {isSidebar && (
<div className="top-bar__inner content"> <div className="top-bar__inner content">
<GroupList className="GroupList" auth={auth} /> <GroupList className="GroupList" auth={auth} />
<div className="top-bar__expander" /> <div className="u-stretch" />
{pendingUpdateCount > 0 && ( {pendingUpdateCount > 0 && (
<Button <Button
className="top-bar__icon-button top-bar__icon-button--refresh" className="top-bar__icon-button top-bar__icon-button--refresh"
......
@use "./mixins/a11y"; @use "./mixins/a11y";
@use "./mixins/layout"; @use "./mixins/layout";
@use "./mixins/utils";
@use './variables' as var;
// Utility classes for layout // Utility classes
.u-stretch { // Use these classes on elements that don't require additional styling
flex-grow: 1;
}
// Layout
// Establish a flex container with a horizontal flow
.u-layout-row { .u-layout-row {
@include layout.row; @include layout.row;
} }
// Establish a row flex container that aligns its children to (vertical) center
.u-layout-row--align-center, .u-layout-row--align-center,
.u-layout-row--align-middle { .u-layout-row--align-middle {
@include layout.row($align: center); @include layout.row($align: center);
} }
// Establish a row flex container that aligns its children along the baseline
.u-layout-row--align-baseline {
@include layout.row($align: baseline);
}
// Establish a row flex container justifies its children right
.u-layout-row--justify-right {
@include layout.row($justify: right);
}
// Use this class to make an element in a flex container "stretchy" and grow
// when there is extra space available.
.u-stretch {
flex-grow: 1;
}
// Put equal, standard spacing between children horizontally
.u-horizontal-rhythm {
@include layout.horizontal-rhythm;
}
// Put equal standard spacing between children vertically
.u-vertical-rhythm { .u-vertical-rhythm {
@include layout.vertical-rhythm; @include layout.vertical-rhythm;
} }
// Icons
// These utilities establish dimensions appropriate for icon elements
// Use for inline icons to size according to text content
.u-icon--inline {
@include utils.icon--inline;
}
.u-icon--large {
@include utils.icon--large;
}
// Misc
// Make element content invisible except to assistive technology
.u-screen-reader-only { .u-screen-reader-only {
@include a11y.screen-reader-only; @include a11y.screen-reader-only;
} }
// Use on elements for a de-emphasized, muted text color
.u-color-text--muted {
color: var.$color-text-light;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment