Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
78675307
Unverified
Commit
78675307
authored
Jun 25, 2020
by
Lyza Gardner
Committed by
GitHub
Jun 25, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2274 from hypothesis/one-liners
Add utility classes for one-liners
parents
a1a7a3d3
30c2c018
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
65 additions
and
85 deletions
+65
-85
annotation-document-info.js
src/sidebar/components/annotation-document-info.js
+3
-3
annotation-header.js
src/sidebar/components/annotation-header.js
+1
-1
annotation-license.js
src/sidebar/components/annotation-license.js
+1
-1
annotation-share-control.js
src/sidebar/components/annotation-share-control.js
+1
-1
annotation-share-info.js
src/sidebar/components/annotation-share-info.js
+1
-1
annotation.js
src/sidebar/components/annotation.js
+2
-2
new-note-btn.js
src/sidebar/components/new-note-btn.js
+1
-1
share-annotations-panel.js
src/sidebar/components/share-annotations-panel.js
+2
-6
top-bar.js
src/sidebar/components/top-bar.js
+2
-2
annotation-document-info.scss
src/styles/sidebar/components/annotation-document-info.scss
+0
-8
annotation-header.scss
src/styles/sidebar/components/annotation-header.scss
+0
-4
annotation-license.scss
src/styles/sidebar/components/annotation-license.scss
+0
-5
annotation-share-control.scss
src/styles/sidebar/components/annotation-share-control.scss
+0
-4
annotation-share-info.scss
src/styles/sidebar/components/annotation-share-info.scss
+0
-2
annotation.scss
src/styles/sidebar/components/annotation.scss
+0
-8
help-panel.scss
src/styles/sidebar/components/help-panel.scss
+0
-1
new-note.scss
src/styles/sidebar/components/new-note.scss
+0
-6
share-annotations-panel.scss
src/styles/sidebar/components/share-annotations-panel.scss
+0
-17
top-bar.scss
src/styles/sidebar/components/top-bar.scss
+0
-6
sidebar.scss
src/styles/sidebar/sidebar.scss
+0
-2
util.scss
src/styles/util.scss
+51
-4
No files found.
src/sidebar/components/annotation-document-info.js
View file @
78675307
...
@@ -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
>
)}
)}
...
...
src/sidebar/components/annotation-header.js
View file @
78675307
...
@@ -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
}
/
>
/
>
...
...
src/sidebar/components/annotation-license.js
View file @
78675307
...
@@ -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"
...
...
src/sidebar/components/annotation-share-control.js
View file @
78675307
...
@@ -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"
...
...
src/sidebar/components/annotation-share-info.js
View file @
78675307
...
@@ -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"
...
...
src/sidebar/components/annotation.js
View file @
78675307
...
@@ -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"
...
...
src/sidebar/components/new-note-btn.js
View file @
78675307
...
@@ -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"
...
...
src/sidebar/components/share-annotations-panel.js
View file @
78675307
...
@@ -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
>
...
...
src/sidebar/components/top-bar.js
View file @
78675307
...
@@ -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"
...
...
src/styles/sidebar/components/annotation-document-info.scss
deleted
100644 → 0
View file @
a1a7a3d3
@use
"../../variables"
as
var
;
@use
"../../mixins/layout"
;
.annotation-document-info
{
@include
layout
.
row
;
@include
layout
.
horizontal-rhythm
;
color
:
var
.
$color-text-light
;
}
src/styles/sidebar/components/annotation-header.scss
View file @
78675307
...
@@ -39,10 +39,6 @@
...
@@ -39,10 +39,6 @@
}
}
}
}
&
__timestamp-created-link
{
color
:
var
.
$color-text-light
;
}
&
__highlight-icon
{
&
__highlight-icon
{
@include
utils
.
icon--small
;
@include
utils
.
icon--small
;
color
:
var
.
$color-text-light
;
color
:
var
.
$color-text-light
;
...
...
src/styles/sidebar/components/annotation-license.scss
View file @
78675307
...
@@ -7,11 +7,6 @@
...
@@ -7,11 +7,6 @@
@include
utils
.
border-top
;
@include
utils
.
border-top
;
padding-top
:
var
.
$layout-margin--small
;
padding-top
:
var
.
$layout-margin--small
;
&
__link
{
@include
layout
.
row
;
color
:
var
.
$color-text-light
;
}
&
__icon
{
&
__icon
{
@include
utils
.
icon--xsmall
;
@include
utils
.
icon--xsmall
;
// Need a tiny space between license icons
// Need a tiny space between license icons
...
...
src/styles/sidebar/components/annotation-share-control.scss
View file @
78675307
...
@@ -17,10 +17,6 @@
...
@@ -17,10 +17,6 @@
width
:
275px
;
width
:
275px
;
cursor
:
default
;
cursor
:
default
;
&
__input
{
@include
layout
.
row
;
}
&
__icon-button
{
&
__icon-button
{
@include
buttons
.
button--input
;
@include
buttons
.
button--input
;
padding
:
var
.
$layout-margin--xsmall
var
.
$layout-margin--small
;
padding
:
var
.
$layout-margin--xsmall
var
.
$layout-margin--small
;
...
...
src/styles/sidebar/components/annotation-share-info.scss
View file @
78675307
...
@@ -3,8 +3,6 @@
...
@@ -3,8 +3,6 @@
@use
"../../mixins/utils"
;
@use
"../../mixins/utils"
;
.annotation-share-info
{
.annotation-share-info
{
@include
layout
.
row
(
$align
:
baseline
);
&
__group
,
&
__group
,
&
__private
{
&
__private
{
@include
layout
.
row
(
$align
:
baseline
);
@include
layout
.
row
(
$align
:
baseline
);
...
...
src/styles/sidebar/components/annotation.scss
View file @
78675307
...
@@ -28,17 +28,9 @@
...
@@ -28,17 +28,9 @@
@include
buttons
.
button--link
;
@include
buttons
.
button--link
;
}
}
&
__controls
{
@include
layout
.
row
;
}
&
__actions
{
&
__actions
{
margin-left
:
auto
;
margin-left
:
auto
;
}
}
&
__form-actions
{
@include
layout
.
row
;
}
}
}
// FIXME move me
// FIXME move me
...
...
src/styles/sidebar/components/help-panel.scss
View file @
78675307
@use
"../../mixins/buttons"
;
@use
"../../mixins/buttons"
;
@use
"../../mixins/layout"
;
@use
"../../mixins/molecules"
;
@use
"../../mixins/molecules"
;
@use
"../../mixins/utils"
;
@use
"../../mixins/utils"
;
@use
"../../variables"
as
var
;
@use
"../../variables"
as
var
;
...
...
src/styles/sidebar/components/new-note.scss
deleted
100644 → 0
View file @
a1a7a3d3
@use
"../../variables"
as
var
;
@use
"../../mixins/layout"
;
.new-note-button
{
@include
layout
.
row
(
right
);
}
src/styles/sidebar/components/share-annotations-panel.scss
View file @
78675307
...
@@ -12,28 +12,11 @@
...
@@ -12,28 +12,11 @@
font-weight
:
500
;
font-weight
:
500
;
}
}
&
__input
{
display
:
flex
;
}
&
__form-input
{
&
__form-input
{
@include
forms
.
form-input--with-button
;
@include
forms
.
form-input--with-button
;
}
}
&
__icon--inline
{
width
:
1em
;
height
:
1em
;
}
&
__icon-button
{
&
__icon-button
{
@include
buttons
.
button--input
;
@include
buttons
.
button--input
;
}
}
.share-annotations-panel-links
{
@include
molecules
.
footer-links
;
&
__icon
{
@include
utils
.
icon--large
;
}
}
}
}
src/styles/sidebar/components/top-bar.scss
View file @
78675307
...
@@ -105,9 +105,3 @@
...
@@ -105,9 +105,3 @@
margin-right
:
auto
;
margin-right
:
auto
;
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
// an expander which adds spacing between the groups list
// and the toolbar icons (in the new top-bar design)
.top-bar__expander
{
flex-grow
:
1
;
}
src/styles/sidebar/sidebar.scss
View file @
78675307
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
// ----------
// ----------
@use
'./components/annotation'
;
@use
'./components/annotation'
;
@use
'./components/annotation-body'
;
@use
'./components/annotation-body'
;
@use
'./components/annotation-document-info'
;
@use
'./components/annotation-header'
;
@use
'./components/annotation-header'
;
@use
'./components/annotation-license'
;
@use
'./components/annotation-license'
;
@use
'./components/annotation-publish-control'
;
@use
'./components/annotation-publish-control'
;
...
@@ -38,7 +37,6 @@
...
@@ -38,7 +37,6 @@
@use
'./components/menu-item'
;
@use
'./components/menu-item'
;
@use
'./components/menu-section'
;
@use
'./components/menu-section'
;
@use
'./components/moderation-banner'
;
@use
'./components/moderation-banner'
;
@use
'./components/new-note'
;
@use
'./components/search-status-bar'
;
@use
'./components/search-status-bar'
;
@use
'./components/selection-tabs'
;
@use
'./components/selection-tabs'
;
@use
'./components/share-annotations-panel'
;
@use
'./components/share-annotations-panel'
;
...
...
src/styles/util.scss
View file @
78675307
@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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment