Skip to content

Commit 52d141b

Browse files
author
Salma Alam-Naylor
committed
Use rems for note sizes, fix display of note names in left handed config
1 parent 0af90b5 commit 52d141b

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

apps/fretonator-web/src/app/common/fretonator/fretboard/fretboard.component.scss

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
@import "../../../../styles/mixins";
44
@import "../../../../styles/typography";
55

6+
$note-height: 36;
7+
68
.fretboard__container {
79
margin-top: pxToRem($grid-unit * 1);
810
max-width: $fretonator_max_width;
911
margin-left: auto;
1012
margin-right: auto;
1113
padding-right: 0;
12-
padding-left: pxToRem($grid-unit * 4);
14+
padding-left: pxToRem($grid-unit * 5);
1315
padding-bottom: pxToRem($grid-unit * 4);
1416
padding-top: pxToRem($grid-unit * 9);
1517
overflow-x: auto;
@@ -21,7 +23,7 @@
2123

2224
&.fretboard__flip {
2325
padding-left: 0;
24-
padding-right: pxToRem($grid-unit * 4);
26+
padding-right: pxToRem($grid-unit * 5);
2527
direction: rtl;
2628
}
2729
}
@@ -251,9 +253,9 @@
251253

252254
&:after {
253255
content: attr(data-display-note);
254-
height: var(--note-height);
255-
width: var(--note-height);
256-
line-height: var(--note-height);
256+
height: pxToRem($note-height);
257+
width: pxToRem($note-height);
258+
line-height: pxToRem($note-height);
257259
left: 50%;
258260
right: unset;
259261
box-sizing: border-box;
@@ -268,13 +270,7 @@
268270
transition-duration: 0.1s;
269271
transition-property: line-height, height, width, opacity;
270272
transition-timing-function: ease-in-out;
271-
}
272-
273-
&:hover:after,
274-
&:active:after {
275-
height: var(--note-height-hover);
276-
width: var(--note-height-hover);
277-
line-height: var(--note-height-hover);
273+
direction: ltr;
278274
}
279275

280276
&:nth-child(-n + 13):after {
@@ -333,15 +329,15 @@
333329

334330
&:after {
335331
content: attr(data-string-name);
336-
height: var(--note-height);
337-
width: var(--note-height);
332+
height: pxToRem($note-height);
333+
width: pxToRem($note-height);
338334
left: 0;
339335
right: unset;
340336
box-sizing: border-box;
341337
border-radius: 50%;
342338
transform: translate(-50%, 50%);
343339
color: var(--string-color);
344-
line-height: var(--note-height);
340+
line-height: pxToRem($note-height);
345341
text-align: center;
346342
font-weight: var(--font-weight-bold);
347343
font-family: var(--font-family-main);

apps/fretonator-web/src/styles.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
--note-color: #fafac6;
3636
--note-background: #1c1c1c;
37-
--note-height: 36px;
38-
--note-height-hover: 39px;
3937

4038
--note-bg-tonic: #fecdaa;
4139
--note-color-tonic: #1c1c1c;
@@ -89,6 +87,7 @@
8987

9088
body {
9189
margin: 0;
90+
font-size: 16px;
9291
font-family: var(--font-family-main);
9392
font-weight: var(--font-weight-normal);
9493
background-color: var(--background-color-base);

0 commit comments

Comments
 (0)