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
836adf88
Commit
836adf88
authored
Apr 08, 2021
by
Lyza Danger Gardner
Committed by
Lyza Gardner
Apr 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure common buttons SASS modules and make `reset` mixin public
parent
8b17791a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
31 deletions
+31
-31
_index.scss
src/styles/shared/_index.scss
+1
-1
_base.scss
src/styles/shared/components/buttons/_base.scss
+0
-9
_index.scss
src/styles/shared/components/buttons/_index.scss
+2
-16
_mixins.scss
src/styles/shared/components/buttons/_mixins.scss
+11
-4
_styles.scss
src/styles/shared/components/buttons/_styles.scss
+16
-0
buttons.scss
src/styles/sidebar/buttons.scss
+1
-1
No files found.
src/styles/shared/_index.scss
View file @
836adf88
@use
'./components/buttons'
;
@use
'./components/buttons
/styles
'
;
src/styles/shared/components/buttons/_base.scss
View file @
836adf88
@use
"sass:map"
;
@use
"@hypothesis/frontend-shared/styles/mixins/focus"
;
// Set colors for a button
@mixin
_colors
(
$colormap
)
{
color
:
map
.
get
(
$colormap
,
'foreground'
);
...
...
@@ -53,13 +51,6 @@
// Base mixin for buttons.
@mixin
button
(
$options
)
{
// Reset browser defaults
@include
focus
.
outline-on-keyboard-focus
;
padding
:
0
;
margin
:
0
;
background-color
:
transparent
;
border-style
:
none
;
@include
_colors
(
map
.
get
(
$options
,
'colormap'
));
@if
map
.
get
(
$options
,
'withStates'
)
{
...
...
src/styles/shared/components/buttons/_index.scss
View file @
836adf88
@use
'./mixins'
;
// A button with text, and optionally an icon
.LabeledButton
{
@include
mixins
.
LabeledButton
;
}
// A button with only an icon and no label/text
.IconButton
{
@include
mixins
.
IconButton
;
}
// A button styled to appear as a link, with underline on hover
.LinkButton
{
@include
mixins
.
LinkButton
;
}
@forward
'config'
;
@forward
'mixins'
;
src/styles/shared/components/buttons/mixins.scss
→
src/styles/shared/components/buttons/
_
mixins.scss
View file @
836adf88
...
...
@@ -2,11 +2,17 @@
@use
"@hypothesis/frontend-shared/styles/mixins/focus"
;
@use
'
./_
config'
as
c
;
@use
'
./_base'
as
base
;
@use
'config'
as
c
;
@use
'
base'
;
// Allow access to the configuration values to users of this module (esp. colors)
@forward
'./_config'
;
// Basic reset for browser-imposed button styles
@mixin
reset
{
@include
focus
.
outline-on-keyboard-focus
;
padding
:
0
;
margin
:
0
;
background-color
:
transparent
;
border-style
:
none
;
}
// Base mixin for <button> elements
@mixin
Button
(
$options
:
())
{
...
...
@@ -33,6 +39,7 @@
);
$-options: map.merge($defaultOptions, $options);
@include reset;
@include base.button($options: $-options);
// Add styles for supported variants as modifier classes, if `withVariants` enabled
...
...
src/styles/shared/components/buttons/_styles.scss
0 → 100644
View file @
836adf88
@use
'mixins'
;
// A button with text, and optionally an icon
.LabeledButton
{
@include
mixins
.
LabeledButton
;
}
// A button with only an icon and no label/text
.IconButton
{
@include
mixins
.
IconButton
;
}
// A button styled to appear as a link, with underline on hover
.LinkButton
{
@include
mixins
.
LinkButton
;
}
src/styles/sidebar/buttons.scss
View file @
836adf88
...
...
@@ -2,7 +2,7 @@
@use
'../variables'
as
var
;
// Button styling for the sidebar extending common button-component styles
@use
'../shared/components/buttons
/mixins'
as
buttons
;
@use
'../shared/components/buttons
'
;
// Similar to `.LinkButton`, with inline layout (so button can be used
// within text)
...
...
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