Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css modules #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/app/layouts/AppLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import Header from './Header'
import Footer from './Footer'
import Header from './header/Header'
import Footer from './footer/Footer'

import classNames from './styles.scss'

export default function AppLayout({ children }) {
return (
<div className="wrapper">
<div className={classNames.wrapper}>
<Header />
<div className="main">
<div className={classNames.main}>
{children}
</div>
<Footer />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Component } from 'react'

import classNames from './styles.scss'

export default class Footer extends Component {
render() {
return (
<footer>Footer</footer>
<footer className={classNames.footer}>Footer</footer>
)
}
}
7 changes: 7 additions & 0 deletions src/app/layouts/footer/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@import 'variables';

.footer {
height: $footer-height;
background-color: $primary;
color: #fff;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Component } from 'react'
import { Link } from 'common/router/Link'

import classNames from './styles.scss'

export default class Header extends Component {
render() {
return (
<header>
<header className={classNames.header}>
<Link to="root">Logo</Link>
<Link to="test">test</Link>
</header>
Expand Down
8 changes: 8 additions & 0 deletions src/app/layouts/header/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import 'variables';

.header {
height: $header-height;
background-color: #fff;
display: flex;
justify-content: space-around;
}
11 changes: 11 additions & 0 deletions src/app/layouts/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import 'variables';

.wrapper {
height: 100%;
background-color: $gray-100;
}

.main {
height: calc(100% - #{$header-height} - #{$footer-height});
overflow: auto;
}
3 changes: 2 additions & 1 deletion src/app/pages/auth/LoginForm.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { TextField } from 'common/forms'
import classNames from './styles.scss'

export default function LoginForm({ handleSubmit }) {
return (
<form onSubmit={handleSubmit}>
<h2>Login</h2>
<TextField name="email" label="Email" type="email" />
<TextField name="password" label="Password" type="password" />
<button>Login</button>
<button className={classNames.btn}>Login</button>
</form>
)
}
5 changes: 5 additions & 0 deletions src/app/pages/auth/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@import 'variables';

.btn {
background: $secondary;
}
22 changes: 0 additions & 22 deletions src/styles/_layout.scss

This file was deleted.

3 changes: 3 additions & 0 deletions src/styles/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@import "functions";
@import "mixins";

/* stylelint-disable number-leading-zero */
// Variables
//
Expand Down
13 changes: 7 additions & 6 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
@import "bootstrap";
@import "./layout";

html,
body,
#root {
height: 100%;
display: block;
:global {
html,
body,
#root {
height: 100%;
display: block;
}
}