Skip to content

Commit fe9c940

Browse files
committed
CSS module for console input
1 parent 723ce7c commit fe9c940

File tree

5 files changed

+38
-26
lines changed

5 files changed

+38
-26
lines changed

src/components/Console.module.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,12 @@
3636
.inactive {
3737
color: var(--color-light-gray);
3838
}
39+
40+
.chevron {
41+
color: var(--color-light-gray);
42+
left: 0;
43+
position: absolute;
44+
top: 0;
45+
transform: scale(0.6);
46+
transform-origin: left center;
47+
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
.expression {
22
composes: row from './Console.module.css';
3+
composes: entry from './Console.module.css';
34
}
45

56
.inactive {
67
composes: inactive from './Console.module.css';
78
}
89

910
.chevron {
10-
color: var(--color-light-gray);
11-
left: 0;
12-
position: absolute;
13-
top: 0;
14-
transform: scale(0.6);
15-
transform-origin: left center;
11+
composes: chevron from './Console.module.css';
1612
}

src/components/ConsoleInput.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {faChevronRight} from '@fortawesome/free-solid-svg-icons';
22
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
33
import bindAll from 'lodash-es/bindAll';
4+
import classnames from 'classnames';
45
import get from 'lodash-es/get';
56
import isNil from 'lodash-es/isNil';
67
import React, {Component} from 'react';
@@ -14,6 +15,8 @@ import {
1415
inheritFontStylesFromParentElement,
1516
} from '../util/ace';
1617

18+
import styles from './ConsoleInput.module.css';
19+
1720
export default class ConsoleInput extends Component {
1821
constructor() {
1922
super();
@@ -119,13 +122,13 @@ export default class ConsoleInput extends Component {
119122
render() {
120123
return (
121124
<div
122-
className="console__row console__input"
125+
className={styles.input}
123126
onClick={preventClickthrough}
124127
>
125-
<div className="console__chevron console__chevron_blue">
128+
<div className={classnames(styles.chevron, styles.blue)}>
126129
<FontAwesomeIcon icon={faChevronRight} />
127130
</div>
128-
<div className="console__editor" ref={this._ref} />
131+
<div className={styles.editor} ref={this._ref} />
129132
</div>
130133
);
131134
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.input {
2+
composes: row from './Console.module.css';
3+
/* TODO: This is mostly duplicated with console entry */
4+
flex: none;
5+
margin-top: 0.5em;
6+
padding-bottom: 0.5em;
7+
height: 1em;
8+
}
9+
10+
.chevron {
11+
composes: chevron from './Console.module.css';
12+
}
13+
14+
.chevron.blue {
15+
color: var(--color-blue);
16+
}
17+
18+
.console__editor {
19+
margin-left: -4px;
20+
}

src/css/application.css

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -634,33 +634,17 @@ body {
634634
transform-origin: left center;
635635
}
636636

637-
.console__chevron_blue {
638-
color: var(--color-blue);
639-
}
640-
641637
.console__chevron_outdent {
642638
text-indent: -0.1em;
643639
}
644640

645-
.console__entry,
646-
.console__input {
641+
.console__entry {
647642
flex: none;
648643
margin-top: 0.5em;
649644
padding-bottom: 0.5em;
650-
}
651-
652-
.console__input {
653-
height: 1em;
654-
}
655-
656-
.console__entry {
657645
border-bottom: 1px solid var(--color-low-contrast-gray);
658646
}
659647

660-
.console__editor {
661-
margin-left: -4px;
662-
}
663-
664648
.console__value {
665649
white-space: pre-wrap;
666650
}

0 commit comments

Comments
 (0)