This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1 Reorganise CSS and library loading.
- Loading branch information
Showing
15 changed files
with
219 additions
and
143 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
html { | ||
height: 100%; | ||
} | ||
body { | ||
padding: 0; | ||
margin: 0; | ||
height: 100vh; | ||
} | ||
.height100p { | ||
height: 100vh; | ||
} | ||
|
||
/** | ||
* Put drawer under the toolbar. | ||
*/ | ||
.mdc-toolbar { | ||
z-index: 60; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
.page-wrapper { | ||
display: flex; | ||
flex-direction: row; | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
height: 100vh; | ||
width: 100%; | ||
} | ||
.content { | ||
display: inline-flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
height: 100vh; | ||
box-sizing: border-box; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Settings Page layout | ||
*/ | ||
|
||
.settings-card-container { | ||
width: 60%; | ||
margin: 0 auto; | ||
padding-top: 10px; | ||
} | ||
.setting-cart-container, .hint { | ||
color: var(--mdc-theme-text-hint-on-light); | ||
} | ||
|
||
.settings-block { | ||
margin: var(--mdc-layout-grid-margin-desktop) | ||
} | ||
|
||
.settings-block .mdc-list-item { | ||
height: auto; | ||
} | ||
|
||
.settings-label { | ||
width: 40%; | ||
float: left; | ||
} | ||
|
||
.settings-content { | ||
width: 100% !important; | ||
} | ||
|
||
.settings-content .mdc-select { | ||
width: 100% !important; | ||
} | ||
|
||
@media (min-width: 840px) { | ||
.settings-content { | ||
width: 60% !important; | ||
float: left; | ||
} | ||
.settings-content .mdc-select { | ||
width: 100% !important; | ||
} | ||
} | ||
|
||
|
||
@media (min-width: 480px) and (max-width: 839px) { | ||
.settings-card-container { | ||
width: 80%; | ||
} | ||
.settings-block { | ||
margin: var(--mdc-layout-grid-margin-tablet) | ||
} | ||
} | ||
@media (max-width: 479px) { | ||
.settings-card-container { | ||
width: 94%; | ||
} | ||
.settings-card-container .mdc-card { | ||
box-shadow: unset; | ||
} | ||
|
||
.settings-block { | ||
margin: var(--mdc-layout-grid-margin-phone) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
/** | ||
* An CSS file loader and importer. | ||
*/ | ||
class Style extends React.Component { | ||
|
||
/** | ||
* Define properties. | ||
* | ||
* @returns {Object} | ||
*/ | ||
static get propTypes() { | ||
return { | ||
src: PropTypes.string.isRequired, | ||
enabled: PropTypes.bool | ||
}; | ||
} | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param {Object} props | ||
* @param {Object} context | ||
* @param {Object} updater | ||
*/ | ||
constructor(props, context, updater) { | ||
super(props, context, updater); | ||
} | ||
|
||
render() { | ||
return <link rel="stylesheet" href={this.props.enabled === false ? '' : this.props.src}/>; | ||
} | ||
} | ||
|
||
export default Style; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import {shallow} from 'enzyme'; | ||
import Style from './Style'; | ||
|
||
/** | ||
* Test the style loader. | ||
*/ | ||
describe('Shared: Style', function testSharedStyle() { | ||
'use strict'; | ||
|
||
/** | ||
* Test that url passing correctly. | ||
*/ | ||
it('Loads css file', function testFileLoad() { | ||
const wrapper = shallow(<Style src="/test.css"/>); | ||
expect(wrapper.html()).toBe('<link rel="stylesheet" href="/test.css"/>'); | ||
}); | ||
|
||
/** | ||
* Test that url not passed if not enabled. | ||
*/ | ||
it('Turn off if not enabled', function testFileLoad() { | ||
const wrapper = shallow(<Style src="/test.css" enabled={false}/>); | ||
expect(wrapper.html()).toBe('<link rel="stylesheet" href=""/>'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
//import './material.min.css'; // custom colors | ||
|
||
import MDC from './Shared/MDC'; | ||
import Style from './Shared/Style'; | ||
|
||
global.MDC = MDC; | ||
global.Style = Style; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.