Skip to content

Commit 81c6bd8

Browse files
authored
Merge pull request #250 from MITLibraries/use-101
USE-101: Style tweaks to SuggestionPanel and refactor of SuggestionPanel variables
2 parents 4efba2c + aacda4f commit 81c6bd8

File tree

5 files changed

+54
-49
lines changed

5 files changed

+54
-49
lines changed

app/assets/stylesheets/partials/_effects.scss

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@
44

55
// ANIMATION
66

7-
@mixin text-decoration-animation( $speed ) {
8-
transition: text-decoration #{$speed} ease;
7+
@mixin text-decoration-animation {
8+
transition: text-decoration 150ms ease;
99
text-decoration: none; // Included as fallback if text-decoration-color isn't supported
1010
text-decoration: underline transparent;
1111
}
1212

13+
@mixin hover-transition {
14+
transition: all .25s ease-in-out 0s;
15+
}
16+
1317
// OUTLINE
1418

15-
@mixin set-focus-outline() {
19+
@mixin set-focus-outline-dark() {
1620
*:focus-visible {
1721
outline: 2px solid $color-focus-dark;
1822
}
1923
}
24+
25+
@mixin set-focus-outline() {
26+
*:focus-visible {
27+
outline: 2px solid $color-focus;
28+
}
29+
}

app/assets/stylesheets/partials/_header.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.institute-bar, .libraries-header {
2-
@include set-focus-outline();
2+
@include set-focus-outline-dark();
33
}
44

55
.institute-bar {
@@ -23,7 +23,7 @@
2323
color: $color-gray-300;
2424
font-size: 1.5rem;
2525
padding-top: 2px;
26-
@include text-decoration-animation(150ms);
26+
@include text-decoration-animation;
2727

2828
&:hover {
2929
text-decoration: underline;
@@ -61,7 +61,7 @@
6161
.platform-name {
6262
color: $color-white;
6363
font-size: 2.4rem;
64-
@include text-decoration-animation(150ms);
64+
@include text-decoration-animation;
6565

6666
&:hover {
6767
text-decoration: underline;
@@ -80,7 +80,7 @@
8080
color: $color-white;
8181
font-size: 1.8rem;
8282
font-weight: $fw-medium;
83-
@include text-decoration-animation(150ms);
83+
@include text-decoration-animation;
8484

8585
&:hover {
8686
text-decoration: underline;

app/assets/stylesheets/partials/_layouts.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// FOOTER STYLES
4040

4141
.wrap-outer-footer, .wrap-outer-footer-institute {
42-
@include set-focus-outline();
42+
@include set-focus-outline-dark();
4343
}
4444

4545

Lines changed: 18 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,9 @@
1-
/* Color Variables */
1+
#hint {padding-top: 24px;} //Temporary spacing above panel until we can revisit entire page layout
22

3-
// Core
4-
$blue-500: #0000FF;
5-
6-
$purple-700: #990099;
7-
8-
$white: #fff;
9-
$gray-100: #F2F2F2;
10-
$black: #111;
11-
12-
@mixin focus-outline {
13-
&:focus {
14-
outline: 3px solid $blue-500;
15-
}
16-
}
17-
18-
@mixin hover-transition {
19-
transition: all .25s ease-in-out 0s;
20-
}
21-
22-
// Semantic
23-
$color-suggestion-border: $purple-700;
24-
$color-suggestion-accent-text: $purple-700;
25-
26-
/* Suggestion Panel */
273
.mitlib-suggestion-panel {
4+
5+
@include set-focus-outline;
6+
287
border: 4px solid $color-suggestion-border;
298

309
display: flex;
@@ -35,24 +14,26 @@ $color-suggestion-accent-text: $purple-700;
3514

3615
.panel-type {
3716
color: $color-suggestion-accent-text;
38-
font-size: 14px;
17+
font-size: 1.4rem;
3918
font-weight: 600;
4019
margin-bottom: 8px;
4120
}
4221

4322
h3 {
44-
font-size: 20px;
45-
font-weight: 600;
46-
line-height: 1.25;
23+
font-size: 2rem;
4724
margin-bottom: 8px;
4825
}
4926

5027
p {
51-
font-size: 16px;
28+
font-size: 1.6rem;
29+
30+
&:last-child {
31+
margin-bottom: 0;
32+
}
5233
}
5334

5435
ul.metadata {
55-
font-size: 14px;
36+
font-size: 1.4rem;
5637
list-style: none inside;
5738
padding-left: 0;
5839
margin-bottom: 20px;
@@ -69,25 +50,23 @@ $color-suggestion-accent-text: $purple-700;
6950
top: 0;
7051
right: 0;
7152

72-
background-color: $white;
53+
background-color: $color-white;
7354
border: none;
74-
color: $black;
55+
color: $color-text-primary;
7556
cursor: pointer;
7657
font-weight: 600;
7758

7859
@include hover-transition;
7960

80-
@include focus-outline;
81-
8261
&:hover {
83-
background-color: $gray-100;
62+
background-color: $color-gray-100;
8463
}
8564
}
8665
}
8766

8867
/* Button styles to be extracted into button component */
8968
.button.secondary {
90-
border: 1px solid $black;
69+
border: 1px solid $color-black;
9170
border-radius: 0;
9271
display: inline-block;
9372
padding: 6px 12px;
@@ -97,10 +76,8 @@ $color-suggestion-accent-text: $purple-700;
9776

9877
@include hover-transition;
9978

100-
@include focus-outline;
101-
10279
&:hover {
103-
color: $white;
104-
background-color: $black;
80+
color: $color-white;
81+
background-color: $color-black;
10582
}
10683
}

app/assets/stylesheets/partials/_variables.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
// #COLOR
33
// ----------------------------
44

5+
6+
57
// GRAY
8+
$color-gray-100: #F2F2F2;
69
$color-gray-200: #e6e6e6;
710
$color-gray-300: #ccc;
811
$color-gray-400: #b3b3b3;
@@ -20,18 +23,33 @@ $color-red-600: #e50000;
2023
$color-cyan-500: #00C8FF;
2124
$color-cyan-700: #00A0CC;
2225

26+
// BLUE
27+
$color-blue-500: #0000FF;
28+
29+
// PURPLE
30+
$color-purple-700: #990099;
31+
32+
33+
// ---------------
2334
// SEMANTIC COLORS
35+
2436
$color-black: #000;
2537
$color-white: #fff;
2638

39+
// TEXT
2740
$color-text-primary: $color-gray-950;
2841
$color-text-secondary: $color-gray-700;
2942
$color-text-placeholder: $color-gray-500;
3043
$color-text-disabled: $color-gray-400;
3144

45+
// FOCUS
3246
$color-focus: $color-cyan-700;
3347
$color-focus-dark: $color-cyan-500;
3448

49+
// SUGGESTION
50+
$color-suggestion-border: $color-purple-700;
51+
$color-suggestion-accent-text: $color-purple-700;
52+
3553
// ----------------------------
3654
// #TYPOGRAPHY
3755
// ----------------------------

0 commit comments

Comments
 (0)