Skip to content

Commit f3d6cef

Browse files
committed
Feat: Add font size buttons
1 parent 291b5e3 commit f3d6cef

File tree

2 files changed

+63
-18
lines changed

2 files changed

+63
-18
lines changed

src/NoteEditor.js

+39-18
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ function NoteEditor(props) {
1313

1414
// Set default screen size - full
1515
const [splitscreen, setSplitscreen] = useState(false);
16+
1617
const styles = {
1718
main_editor: {
1819
paddingLeft: "5px",
@@ -45,6 +46,20 @@ function NoteEditor(props) {
4546
height: "100%",
4647
borderRadius: "5px",
4748
},
49+
inputNum: {
50+
width: "4.26rem",
51+
height: "2.7rem",
52+
borderRadius: "4px 2px 2px 4px",
53+
color: "#292a2b",
54+
padding: "0.1ex 1ex",
55+
border: "1px solid #ccc",
56+
fontWeight: 250,
57+
textShadow: "1px 1px 1px rgba(0, 0, 0, 0.1)",
58+
outline: "none",
59+
display: "inline-flex",
60+
alignItems: "center",
61+
justifyContent: "center",
62+
},
4863
dark: {
4964
backgroundColor: "hsl(0, 0%, 14%)",
5065
color: "#afafaf",
@@ -455,24 +470,30 @@ function NoteEditor(props) {
455470
>
456471
<span className="tooltiptext">Strikethrough</span>
457472
</i>
458-
<InputNumber
459-
min={10}
460-
max={48}
461-
step={1}
462-
value={fontsize}
463-
onChange={setFontsize}
464-
style={{
465-
width: "4.2rem",
466-
height: "2.7rem",
467-
borderRadius: "4px 2px 2px 4px",
468-
color: "#292a2b",
469-
padding: "0.1ex 1ex",
470-
border: "1px solid #ccc",
471-
fontWeight: 100,
472-
textShadow: "1px 1px 1px rgba(0, 0, 0, 0.1)",
473-
outline: "none",
474-
}}
475-
/>
473+
474+
<span className="input-div">
475+
<i
476+
className="fas fa-angle-left fa-lg fnt_btn"
477+
onClick={(e) => setFontsize(fontsize - 1)}
478+
></i>
479+
<InputNumber
480+
min={10}
481+
max={48}
482+
step={1}
483+
value={fontsize}
484+
onChange={setFontsize}
485+
style={{ ...styles.inputNum, ...styles.btn_dark }}
486+
style={
487+
toggleState.theme === "vs-light"
488+
? { ...styles.inputNum, ...styles.btn_light }
489+
: { ...styles.inputNum, ...styles.btn_dark }
490+
}
491+
/>
492+
<i
493+
className="fas fa-angle-right fa-lg fnt_btn"
494+
onClick={(e) => setFontsize(fontsize + 1)}
495+
></i>
496+
</span>
476497

477498
<div style={styles.buttons}>
478499
<i

src/styles.css

+24
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,20 @@ button[disabled]:hover {
551551
padding: 6px 12px;
552552
}
553553

554+
.fnt_btn {
555+
border: none;
556+
outline: none;
557+
cursor: pointer;
558+
margin: 2px;
559+
background-color: #fff;
560+
color: #5c5c5c;
561+
font-size: 1.8rem;
562+
text-align: center;
563+
white-space: nowrap;
564+
vertical-align: middle;
565+
padding: 6px 12px;
566+
}
567+
554568
/* WIP */
555569
.tooltiptext {
556570
visibility: hidden;
@@ -591,6 +605,16 @@ button[disabled]:hover {
591605
font-size: 1.55rem;
592606
}
593607

608+
.fnt_btn:hover {
609+
opacity: 0.6;
610+
}
611+
594612
input[type="number"] {
595613
width: 4rem;
596614
}
615+
616+
.input-div {
617+
display: inline-flex;
618+
align-items: center;
619+
justify-content: center;
620+
}

0 commit comments

Comments
 (0)