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
501f835b
Commit
501f835b
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
Add mixin for `menu-arrow`
parent
67315d48
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
molecules.scss
src/styles/mixins/molecules.scss
+19
-0
annotation-share-control.scss
src/styles/sidebar/components/annotation-share-control.scss
+2
-7
menu.scss
src/styles/sidebar/components/menu.scss
+2
-4
No files found.
src/styles/mixins/molecules.scss
View file @
501f835b
...
...
@@ -63,6 +63,25 @@
}
}
/**
* A pattern for styling a little "pointer" (arrow) icon that attaches to
* menu content and serves as a visual anchor back to the triggering
* button/element. When using, you'll need to provide the appropriate
* positioning details to get the pointer to be where you want it in the
* given menu.
*
* @param {string} [$direction] - Which direction the arrow should "point"
*/
@mixin
menu-arrow
(
$direction
:
'up'
)
{
position
:
absolute
;
z-index
:
2
;
color
:
var
.
$color-border
;
fill
:
var
.
$color-background
;
@if
(
$direction
==
'down'
)
{
transform
:
rotateX
(
180deg
);
}
}
/**
* A pattern for displaying redacted (moderated) text content
*/
...
...
src/styles/sidebar/components/annotation-share-control.scss
View file @
501f835b
...
...
@@ -42,16 +42,11 @@
}
// Position the pointer icon absolutely and flip it to make it point at the
// share icon. Fill it with background color and give it the same color as
// the border to make it look like part of the panel frame.
// share icon
&
__arrow
{
position
:
absolute
;
z-index
:
100
;
@include
molecules
.
menu-arrow
(
$direction
:
'down'
);
right
:
0px
;
bottom
:
-8px
;
color
:
var
.
$color-border
;
fill
:
var
.
$color-background
;
transform
:
rotateX
(
180deg
);
}
.share-links__icon
{
...
...
src/styles/sidebar/components/menu.scss
View file @
501f835b
@use
"../../mixins/focus"
;
@use
"../../mixins/layout"
;
@use
"../../mixins/molecules"
;
@use
"../../mixins/utils"
;
@use
"../../variables"
as
var
;
...
...
@@ -56,17 +57,14 @@
// Triangular indicator at the top of the menu that associates it with the
// toggle button.
.menu__arrow
{
color
:
var
.
$grey-3
;
fill
:
white
;
@include
molecules
.
menu-arrow
;
// Position the arrow so that it appears flush with the right edge of the
// content when the menu is right-aligned, and the bottom of the arrow just
// overlaps the content's border. The effect is that the menu's border is a
// rounded rect with a notch at the top.
position
:
absolute
;
top
:
calc
(
100%
-
2px
);
// nb. Adjust this if changing the <svg> size.
right
:
0
;
z-index
:
2
;
}
// Content area of the menu.
...
...
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