feat(night-mode): Add initial night mode styles
This commit is contained in:
@ -11,12 +11,14 @@ import { flashMessagesSelector, removeFlashMessage } from './Flash/redux';
|
|||||||
import Flash from './Flash';
|
import Flash from './Flash';
|
||||||
import Header from './Header';
|
import Header from './Header';
|
||||||
|
|
||||||
import './layout.css';
|
|
||||||
import './global.css';
|
import './global.css';
|
||||||
|
import './layout.css';
|
||||||
|
import './night.css';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
children: PropTypes.node.isRequired,
|
children: PropTypes.node.isRequired,
|
||||||
disableSettings: PropTypes.bool,
|
disableSettings: PropTypes.bool,
|
||||||
|
fetchUser: PropTypes.func.isRequired,
|
||||||
flashMessages: PropTypes.arrayOf(
|
flashMessages: PropTypes.arrayOf(
|
||||||
PropTypes.shape({
|
PropTypes.shape({
|
||||||
id: PropTypes.string,
|
id: PropTypes.string,
|
||||||
@ -26,6 +28,7 @@ const propTypes = {
|
|||||||
),
|
),
|
||||||
hasMessages: PropTypes.bool,
|
hasMessages: PropTypes.bool,
|
||||||
isSignedIn: PropTypes.bool,
|
isSignedIn: PropTypes.bool,
|
||||||
|
landingPage: PropTypes.bool,
|
||||||
removeFlashMessage: PropTypes.func.isRequired
|
removeFlashMessage: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -54,7 +57,8 @@ class Layout extends Component {
|
|||||||
disableSettings,
|
disableSettings,
|
||||||
hasMessages,
|
hasMessages,
|
||||||
flashMessages = [],
|
flashMessages = [],
|
||||||
removeFlashMessage
|
removeFlashMessage,
|
||||||
|
landingPage
|
||||||
} = this.props;
|
} = this.props;
|
||||||
return (
|
return (
|
||||||
<StaticQuery
|
<StaticQuery
|
||||||
@ -77,12 +81,12 @@ class Layout extends Component {
|
|||||||
title={data.site.siteMetadata.title}
|
title={data.site.siteMetadata.title}
|
||||||
/>
|
/>
|
||||||
<Header disableSettings={disableSettings} />
|
<Header disableSettings={disableSettings} />
|
||||||
<div style={{ marginTop: '38px' }}>
|
<main className={landingPage && 'landing-page'}>
|
||||||
{hasMessages ? (
|
{hasMessages ? (
|
||||||
<Flash messages={flashMessages} onClose={removeFlashMessage} />
|
<Flash messages={flashMessages} onClose={removeFlashMessage} />
|
||||||
) : null}
|
) : null}
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</main>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
@ -27,5 +27,4 @@ h6 {
|
|||||||
.btn-invert {
|
.btn-invert {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
color: #006400;
|
color: #006400;
|
||||||
|
|
||||||
}
|
}
|
@ -622,3 +622,6 @@ pre tt:after {
|
|||||||
font-size: 100%;
|
font-size: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
main {
|
||||||
|
margin-top: 38px;
|
||||||
|
}
|
31
client/src/components/night.css
Normal file
31
client/src/components/night.css
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
.night body {
|
||||||
|
background-color: #333;
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.night .btn-invert {
|
||||||
|
background-color: #ddd;
|
||||||
|
color: #006400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.night .btn-invert:hover, .night .btn-invert:focus {
|
||||||
|
background-color: #006400;
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.night .toggle-active {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.night input, .night textarea {
|
||||||
|
background-color: #ddd;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.night #top-right-nav li > a, .night #top-right-nav li > span {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.night .btn.btn-primary {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
@ -1,3 +1,17 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
Embrace the cascade to override night mode styles
|
||||||
|
This ensures a consistent landing page, even for users with nigt mode enabled
|
||||||
|
*/
|
||||||
|
.night body .landing-page{
|
||||||
|
background-color: #fff;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.night .landing-page #top-right-nav li > a, .night #top-right-nav li > span {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
/* End night mode override */
|
||||||
|
|
||||||
.black-text {
|
.black-text {
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
@ -26,7 +26,7 @@ const BigCallToAction = () => (
|
|||||||
);
|
);
|
||||||
|
|
||||||
const IndexPage = () => (
|
const IndexPage = () => (
|
||||||
<Layout disableSettings={true}>
|
<Layout disableSettings={true} landingPage={true}>
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<Grid className='text-center'>
|
<Grid className='text-center'>
|
||||||
|
Reference in New Issue
Block a user