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
1eb65bfa
Commit
1eb65bfa
authored
May 10, 2022
by
Lyza Danger Gardner
Committed by
Lyza Gardner
May 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove external dependencies from `highlights.scss`
parent
30f18b3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
+31
-9
highlights.scss
src/styles/annotator/highlights.scss
+31
-9
No files found.
src/styles/annotator/highlights.scss
View file @
1eb65bfa
@use
'../variables'
as
var
;
$color-highlight
:
rgba
(
255
,
255
,
60
,
0
.4
);
@use
'../mixins/a11y'
;
$color-highlight-second
:
rgba
(
206
,
206
,
60
,
0
.4
);
$color-highlight-focused
:
rgba
(
156
,
230
,
255
,
0
.5
);
// Hide content from sighted users but make it visible to screen readers.
//
// Resources:
// - https://webaim.org/techniques/css/invisiblecontent/ (see "CSS clip")
// - https://cloudfour.com/thinks/see-no-evil-hidden-content-and-accessibility/#showing-additional-content-for-screen-readers
// - https://tailwindcss.com/docs/screen-readers#screen-reader-only-elements Tailwind's `sr-only` class
@mixin
screen-reader-only
{
// Take the content out of the normal layout flow.
position
:
absolute
;
width
:
1px
;
height
:
1px
;
white-space
:
nowrap
;
// Visually hide the content and prevent it from interfering with mouse/touch
// text selection by clipping it to an empty box. Compared to moving content with
// `top`/`left` this is less likely to cause the browser to scroll to a
// different part of the page when the hidden text has screen-reader focus.
clip
:
rect
(
0
0
0
0
);
overflow
:
hidden
;
}
// SVG highlights when the "Show Highlights" toggle is turned off.
// SVG highlights when the "Show Highlights" toggle is turned off.
.hypothesis-svg-highlight
{
.hypothesis-svg-highlight
{
...
@@ -10,19 +32,19 @@
...
@@ -10,19 +32,19 @@
// of the annotated document when highlights are enabled/disabled.
// of the annotated document when highlights are enabled/disabled.
.hypothesis-highlights-always-on
{
.hypothesis-highlights-always-on
{
.hypothesis-svg-highlight
{
.hypothesis-svg-highlight
{
fill
:
var
.
$color-highlight
;
fill
:
$color-highlight
;
&
.is-opaque
{
&
.is-opaque
{
fill
:
yellow
;
fill
:
yellow
;
}
}
&
.is-focused
{
&
.is-focused
{
fill
:
var
.
$color-highlight-focused
;
fill
:
$color-highlight-focused
;
}
}
}
}
.hypothesis-highlight
{
.hypothesis-highlight
{
background-color
:
var
.
$color-highlight
;
background-color
:
$color-highlight
;
// For PDFs, we still create highlight elements to wrap the text but the
// For PDFs, we still create highlight elements to wrap the text but the
// highlight effect is created by another element.
// highlight effect is created by another element.
...
@@ -35,20 +57,20 @@
...
@@ -35,20 +57,20 @@
// Make highlights visible to screen readers.
// Make highlights visible to screen readers.
// See also - https://developer.paciellogroup.com/blog/2017/12/short-note-on-making-your-mark-more-accessible/.
// See also - https://developer.paciellogroup.com/blog/2017/12/short-note-on-making-your-mark-more-accessible/.
&
:
:
before
{
&
:
:
before
{
@include
a11y
.
screen-reader-only
;
@include
screen-reader-only
;
// nb. The leading/trailing spaces are intended to ensure the text is treated
// nb. The leading/trailing spaces are intended to ensure the text is treated
// as separate words by assistive technologies from the content before/after it.
// as separate words by assistive technologies from the content before/after it.
content
:
' annotation start '
;
content
:
' annotation start '
;
}
}
&
:
:
after
{
&
:
:
after
{
@include
a11y
.
screen-reader-only
;
@include
screen-reader-only
;
content
:
' annotation end '
;
content
:
' annotation end '
;
}
}
// Give a highlight inside a larger highlight a different color to stand out.
// Give a highlight inside a larger highlight a different color to stand out.
&
.hypothesis-highlight
{
&
.hypothesis-highlight
{
background-color
:
var
.
$color-highlight-second
;
background-color
:
$color-highlight-second
;
&
.is-transparent
{
&
.is-transparent
{
background-color
:
transparent
;
background-color
:
transparent
;
}
}
...
@@ -69,7 +91,7 @@
...
@@ -69,7 +91,7 @@
// When an annotation card is hovered in the sidebar, the corresponding
// When an annotation card is hovered in the sidebar, the corresponding
// highlights are shown with a "focused" color.
// highlights are shown with a "focused" color.
&
.hypothesis-highlight-focused
{
&
.hypothesis-highlight-focused
{
background-color
:
var
.
$color-highlight-focused
!
important
;
background-color
:
$color-highlight-focused
!
important
;
.hypothesis-highlight
{
.hypothesis-highlight
{
background-color
:
transparent
!
important
;
background-color
:
transparent
!
important
;
...
...
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