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
58bac04c
Commit
58bac04c
authored
Nov 01, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Nov 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract `quoted-text` and `redacted-text` into local pattern classes
parent
7a3232ef
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
60 deletions
+29
-60
AnnotationBody.js
src/sidebar/components/Annotation/AnnotationBody.js
+3
-3
AnnotationQuote.js
src/sidebar/components/Annotation/AnnotationQuote.js
+3
-2
molecules.scss
src/styles/mixins/molecules.scss
+0
-26
patterns.scss
src/styles/patterns.scss
+23
-0
AnnotationBody.scss
src/styles/sidebar/components/AnnotationBody.scss
+0
-15
AnnotationQuote.scss
src/styles/sidebar/components/AnnotationQuote.scss
+0
-12
sidebar.scss
src/styles/sidebar/sidebar.scss
+0
-2
No files found.
src/sidebar/components/Annotation/AnnotationBody.js
View file @
58bac04c
...
...
@@ -49,7 +49,7 @@ function AnnotationBody({ annotation, settings }) {
const
textStyle
=
applyTheme
([
'annotationFontFamily'
],
settings
);
return
(
<
div
className
=
"
AnnotationBody
"
>
<
div
className
=
"
hyp-u-vertical-spacing--2
"
>
{
showExcerpt
&&
(
<
Excerpt
collapse
=
{
isCollapsed
}
...
...
@@ -64,13 +64,13 @@ function AnnotationBody({ annotation, settings }) {
markdown
=
{
text
}
textClass
=
{{
AnnotationBody__text
:
true
,
'
is-hidden
'
:
isHidden
(
annotation
),
'
p-redacted-content
'
:
isHidden
(
annotation
),
}}
/
>
<
/Excerpt
>
)}
{
isCollapsible
&&
(
<
div
className
=
"
AnnotationBody__collapse-toggle
"
>
<
div
className
=
"
hyp-u-layout-row--justify-right
"
>
<
LabeledButton
expanded
=
{
!
isCollapsed
}
onClick
=
{()
=>
setIsCollapsed
(
!
isCollapsed
)}
...
...
src/sidebar/components/Annotation/AnnotationQuote.js
View file @
58bac04c
...
...
@@ -36,7 +36,7 @@ function AnnotationQuote({ annotation, isFocused, settings = {} }) {
return
(
<
div
className
=
{
classnames
(
'AnnotationQuote'
,
{
className
=
{
classnames
({
'is-orphan'
:
isOrphan
(
annotation
),
})}
>
...
...
@@ -46,8 +46,9 @@ function AnnotationQuote({ annotation, isFocused, settings = {} }) {
overflowThreshold
=
{
20
}
>
<
blockquote
className
=
{
classnames
(
'
AnnotationQuote__quote
'
,
{
className
=
{
classnames
(
'
p-quoted-text
'
,
{
'is-focused'
:
isFocused
,
'p-redacted-content'
:
isOrphan
(
annotation
),
})}
dir
=
"auto"
lang
=
{
documentLanguage
}
...
...
src/styles/mixins/molecules.scss
View file @
58bac04c
...
...
@@ -85,32 +85,6 @@
}
}
/**
* A pattern for displaying redacted (moderated) text content
*/
@mixin
redacted-content
{
text-decoration
:
line-through
;
// Make any images within this content greyscale, and low-contrast
filter
:
grayscale
(
100%
)
contrast
(
65%
);
}
/**
* Represent quoted text, as in an excerpt, with a hover or focused state.
*/
@mixin
quoted-text
{
border-left
:
3px
solid
var
.
$color-border
;
color
:
var
.
$color-text--light
;
font-style
:
italic
;
padding
:
0
var
.
$layout-space
;
// Prevent long URLs etc. in quote causing overflow
overflow-wrap
:
break-word
;
&
.is-focused
,
&
:hover
{
border-left
:
var
.
$color-quote
3px
solid
;
}
}
/**
* Base styles for a "panel"-like element, with appropriate
* padding, heading and close-button styles.
...
...
src/styles/patterns.scss
View file @
58bac04c
...
...
@@ -18,3 +18,26 @@
text-decoration
:
underline
;
}
}
// Represent quoted text, as in an excerpt, with a hover or focused state.
.p-quoted-text
{
border-left
:
3px
solid
var
.
$color-border
;
color
:
var
.
$color-text--light
;
font-style
:
italic
;
padding
:
0
var
.
$layout-space
;
// Prevent long URLs etc. in quote causing overflow
overflow-wrap
:
break-word
;
&
.is-focused
,
&
:hover
{
border-left
:
var
.
$color-quote
3px
solid
;
}
}
// A pattern for displaying redacted (moderated) text content
.p-redacted-content
{
text-decoration
:
line-through
;
// Make any images within this content greyscale, and low-contrast
filter
:
grayscale
(
100%
)
contrast
(
65%
);
}
src/styles/sidebar/components/AnnotationBody.scss
deleted
100644 → 0
View file @
7a3232ef
@use
'../../variables'
as
var
;
@use
'../../mixins/buttons'
;
@use
'../../mixins/layout'
;
@use
'../../mixins/molecules'
;
.AnnotationBody__text
{
&
.is-hidden
{
@include
molecules
.
redacted-content
;
}
}
.AnnotationBody__collapse-toggle
{
@include
layout
.
row
(
right
);
@include
layout
.
vertical-space
(
var
.
$layout-space--xsmall
);
}
src/styles/sidebar/components/AnnotationQuote.scss
deleted
100644 → 0
View file @
7a3232ef
@use
'../../variables'
as
var
;
@use
'../../mixins/molecules'
;
.AnnotationQuote
{
&
__quote
{
@include
molecules
.
quoted-text
;
}
&
.is-orphan
&
__quote
{
// In orphans, quotes should be rendered as if they're missing/redacted
@include
molecules
.
redacted-content
;
}
}
src/styles/sidebar/sidebar.scss
View file @
58bac04c
...
...
@@ -19,9 +19,7 @@
// Components
// ----------
@use
'./components/Annotation'
;
@use
'./components/AnnotationBody'
;
@use
'./components/AnnotationPublishControl'
;
@use
'./components/AnnotationQuote'
;
@use
'./components/AnnotationShareControl'
;
@use
'./components/AutocompleteList'
;
@use
'./components/Excerpt'
;
...
...
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