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
35b000bf
Commit
35b000bf
authored
Aug 17, 2020
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Aug 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidate some styling in `Excerpt`
parent
84cbc9db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
73 deletions
+67
-73
excerpt.scss
src/styles/sidebar/components/excerpt.scss
+67
-73
No files found.
src/styles/sidebar/components/excerpt.scss
View file @
35b000bf
@use
"../../mixins/buttons"
;
@use
"../../mixins/buttons"
;
@use
"../../variables"
as
var
;
@use
"../../variables"
as
var
;
// FIXME - Remove the `@at-root` here when SASS modules are used, as local
// the distance by which the shadow indicating a collapsed
// variables will no longer be exposed to other modules.
// annotation expands beyond the left/right edges of the card.
@at-root
{
// This value is chosen such that the shadow expands to the full width of
$expand-duration
:
0
.15s
;
// the card
$shadow-h-offset
:
-12px
;
$expand-duration
:
0
.15s
;
.excerpt
{
.excerpt
{
transition
:
max-height
$expand-duration
ease-in
;
transition
:
max-height
$expand-duration
ease-in
;
overflow
:
hidden
;
overflow
:
hidden
;
position
:
relative
;
position
:
relative
;
}
}
.excerpt__content
{
.excerpt__content
{
// Create a new block-formatting context. This prevents any margins on
// Create a new block-formatting context. This prevents any margins on
// elements inside the excerpt from "leaking out" due to margin-collapsing,
// elements inside the excerpt from "leaking out" due to margin-collapsing,
// which would push this container element away from the top of the excerpt.
// which would push this container element away from the top of the excerpt.
...
@@ -21,65 +23,57 @@
...
@@ -21,65 +23,57 @@
// and https://github.com/hypothesis/client/issues/1518.
// and https://github.com/hypothesis/client/issues/1518.
display
:
inline-block
;
display
:
inline-block
;
width
:
100%
;
width
:
100%
;
}
}
// inline controls for expanding and collapsing
// inline controls for expanding and collapsing
// the <excerpt>
// the excerpt
// -------------
.excerpt__inline-controls
{
.excerpt__inline-controls
{
display
:
block
;
display
:
block
;
position
:
absolute
;
position
:
absolute
;
right
:
0
;
right
:
0
;
bottom
:
0
;
bottom
:
0
;
}
}
.excerpt__toggle-link
{
.excerpt__toggle-link
{
padding-left
:
15px
;
padding-left
:
var
.
$layout-space
;
background-image
:
linear-gradient
(
to
right
,
transparent
0px
,
white
12px
);
// See https://stackoverflow.com/a/56548711/9788954 regarding
}
// rgba(255, 255, 255, 0) used here instead of `transparent` (for Safari)
background-image
:
linear-gradient
(
to
right
,
rgba
(
255
,
255
,
255
,
0
)
0px
,
var
.
$color-background
var
.
$layout-space
);
}
.excerpt__toggle-button
{
// TODO the tap target here is quite small
.excerpt__toggle-button
{
@include
buttons
.
reset-native-btn-styles
;
@include
buttons
.
reset-native-btn-styles
;
background
:
transparent
;
font-style
:
italic
;
font-style
:
italic
;
}
}
.excerpt__toggle-link
>
a
{
color
:
var
.
$color-text
;
font-style
:
italic
;
font-weight
:
normal
;
}
// a shadow displayed at the bottom of an <excerpt>s with inline controls
// disabled, which provides a hint that the excerpt is collapsed
// -------------
// the distance by which the shadow indicating a collapsed
// annotation expands beyond the left/right edges of the card.
// This value is chosen such that the shadow expands to the full width of
// the card
$shadow-h-offset
:
-12px
;
.excerpt__shadow
{
// a shadow displayed at the bottom of an <excerpt>s with inline controls
// disabled, which provides a hint that the excerpt is collapsed
.excerpt__shadow
{
position
:
absolute
;
position
:
absolute
;
left
:
$shadow-h-offset
;
left
:
$shadow-h-offset
;
right
:
$shadow-h-offset
;
right
:
$shadow-h-offset
;
bottom
:
0
;
bottom
:
0
;
height
:
40px
;
height
:
var
.
$touch-target-size
;
background-image
:
linear-gradient
(
background-image
:
linear-gradient
(
to
bottom
,
to
bottom
,
transparent
50%
,
rgba
(
255
,
255
,
255
,
0
)
50%
,
rgba
(
0
,
0
,
0
,
0
.08
)
95%
,
rgba
(
0
,
0
,
0
,
0
.08
)
95%
,
rgba
(
0
,
0
,
0
,
0
.13
)
100%
rgba
(
0
,
0
,
0
,
0
.13
)
100%
);
);
transition
:
opacity
$expand-duration
linear
;
transition
:
opacity
$expand-duration
linear
;
}
}
.excerpt__shadow--transparent
{
.excerpt__shadow--transparent
{
background-image
:
none
;
background-image
:
none
;
}
}
.excerpt__shadow.is-hidden
{
.excerpt__shadow.is-hidden
{
opacity
:
0
;
opacity
:
0
;
pointer-events
:
none
;
pointer-events
:
none
;
}
}
}
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