Skip to content

Commit

Permalink
refactor(protocol-designer): replace old CSS resets with minimal reset (
Browse files Browse the repository at this point in the history
#1672)

- remove normalize.css module
- consolidate grid styles in PD
- minimal `reset.css`
- remove unused css files in protocol-designer/src/css
- update LabwareDropdown.css (no longer rely on old resets)
- remove all old '@value's
- use Open Sans as default font
  • Loading branch information
IanLondon authored Jun 14, 2018
1 parent e302382 commit aeb1785
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 113 deletions.
1 change: 0 additions & 1 deletion protocol-designer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@opentrons/components": "3.2.0-beta.0",
"classnames": "^2.2.5",
"lodash": "^4.17.4",
"normalize.css": "^7.0.0",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-dom": "^16.2.0",
Expand Down
6 changes: 2 additions & 4 deletions protocol-designer/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ import ConnectedDeckSetup from '../containers/ConnectedDeckSetup'
import About from './About'
import ProtocolEditor from './ProtocolEditor'

// to clarify: normalize.css is an npm module
// with a dot in its name, not a .css file in src/
import 'normalize.css'
import '../css/globals.css'
import '../css/reset.css'

export default function App () {
return (
<HashRouter>
<div className='container'>
<Route exact path='/' component={ProtocolEditor} />
{/* TODO: Ian 2018-06-08 remove these unused routes & their components */}
<Route exact path='/old-ingredient-selector' component={ConnectedDeckSetup} />
<Route path='/about' component={About} />
</div>
Expand Down
18 changes: 1 addition & 17 deletions protocol-designer/src/components/Form.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,7 @@
* (more specifically, top of relative parent)
*/
@import '@opentrons/components';

/* TODO Ian 2018-01-24 generic column fraction classes available in component css? */
.column_1_2 {
lost-column: 1/2;
}

.column_1_3 {
lost-column: 1/3;
}

.column_2_3 {
lost-column: 2/3;
}

.column_1_4 {
lost-column: 1/4;
}
@import '../css/grid.css';

.form {
background-color: white;
Expand Down
12 changes: 9 additions & 3 deletions protocol-designer/src/components/LabwareDropdown.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
@import '@opentrons/components';

@value disable_select, close from '../css/mixins.css';
.close {
position: absolute;
right: 0;
top: 0;
cursor: pointer;
}

.labware_dropdown {
position: absolute;
Expand All @@ -14,7 +19,7 @@
border: 3px solid darkgray;
z-index: 500;
color: var(--c-font-dark);
composes: disable_select;
user-select: none;
}

.labware_dropdown label {
Expand All @@ -23,7 +28,8 @@
font-weight: bold;
}

.labware_dropdown > ul {
.labware_dropdown ul {
list-style-type: none;
background-color: white;

/* Overflowing, even just y, messes with tooltips... */
Expand Down
10 changes: 0 additions & 10 deletions protocol-designer/src/components/ProtocolEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,4 @@
.main_page_content {
flex: 1 1;
position: relative;

& h2 {
/** TODO Ian 2018-02-27 is there a better place for making h2's look like headers --
* without making TitleBar etc components headers wrong? */
@apply --font-header-dark;

line-height: 4rem;
padding: 0;
margin: 0;
}
}
6 changes: 2 additions & 4 deletions protocol-designer/src/components/SelectionRect.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
@value rectColor: rgba(0, 120, 255, 0.2);

.selection_rect {
pointer-events: none; /* prevents this div from occluding wells during document.elementFromPoint sampling */
}

rect.selection_rect {
/* svg version */
fill: rectColor;
fill: var(--c-overlay);
stroke: gray;
stroke-width: 0.4;
stroke-dasharray: 0.75, 0.5;
}

div.selection_rect {
/* normal html version */
background-color: rectColor;
background-color: var(--c-overlay);
position: fixed;
z-index: 1000;
border-radius: 0;
Expand Down
2 changes: 0 additions & 2 deletions protocol-designer/src/components/modals/MoreOptionsModal.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import './grid.css';

.big_text_box {
height: 12rem;
}
Expand Down
14 changes: 0 additions & 14 deletions protocol-designer/src/css/colors.css

This file was deleted.

6 changes: 0 additions & 6 deletions protocol-designer/src/css/fontSizes.css

This file was deleted.

33 changes: 0 additions & 33 deletions protocol-designer/src/css/globals.css

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* TODO Ian 2018-02-07 This is duplicated in StepEditForm. Should be in component library? */
/* TODO Ian 2018-07-08 Should be in component library? */

.column_1_2 {
lost-column: 1/2;
Expand Down
14 changes: 0 additions & 14 deletions protocol-designer/src/css/mixins.css

This file was deleted.

13 changes: 13 additions & 0 deletions protocol-designer/src/css/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* TODO: Ian 2018-06-08 PD should import css reset from component library */

body {
font-size: 16px;
line-height: 1;
}

* {
font-family: 'Open Sans', sans-serif;
box-sizing: border-box;
margin: 0;
padding: 0;
}
4 changes: 0 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7345,10 +7345,6 @@ normalize-url@^1.4.0:
query-string "^4.1.0"
sort-keys "^1.0.0"

normalize.css@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/normalize.css/-/normalize.css-7.0.0.tgz#abfb1dd82470674e0322b53ceb1aaf412938e4bf"

npm-lifecycle@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.0.3.tgz#696bedf1143371163e9cc16fe872357e25d8d90e"
Expand Down

0 comments on commit aeb1785

Please sign in to comment.