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

Enable sass compiling in webpack for chrome styles #107

Closed
wants to merge 4 commits into from
Closed
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
8 changes: 3 additions & 5 deletions packages/b-ber-reader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.0.6",
"jest": "^22.4.3",
"nodemon": "^1.17.1",
"node-sass": "^4.8.3",
"postcss": "^6.0.19",
"postcss-cssnext": "^3.1.0",
"postcss-import": "^11.1.0",
"postcss-loader": "^2.1.1",
"nodemon": "^1.17.1",
"rimraf": "^2.6.2",
"sass-loader": "^7.0.1",
"style-loader": "^0.20.2",
"sugarss": "^1.0.1",
"url-loader": "^1.0.1",
"webpack": "^4.1.1",
"webpack-bundle-analyzer": "^2.11.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/b-ber-reader/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {render} from 'react-dom'
import {App} from './components'

import './lib/polyfills'
import './index.sss'
import './index.scss'

render((
<App />
Expand Down
245 changes: 245 additions & 0 deletions packages/b-ber-reader/src/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
$white: #fff;
$black: #000;
$violet: #ee82ee;
$component-x: 30px;
$component-y: 30px;


// base
* {
margin: 0;
padding: 0;
}

ul,
ol {
list-style: none;
}

button {
appearance: none;
background: transparent;
border: 0;
display: block;
outline: none;
}

// icons
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(~material-design-icons/iconfont/MaterialIcons-Regular.eot?#iefix) format('embedded-opentype'),
local('Material Icons'),
local('MaterialIcons-Regular'),
url(~material-design-icons/iconfont/MaterialIcons-Regular.woff2) format('woff2'),
url(~material-design-icons/iconfont/MaterialIcons-Regular.woff) format('woff'),
url(~material-design-icons/iconfont/MaterialIcons-Regular.ttf) format('truetype');
}

.material-icons {
display: inline-block;
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
font-feature-settings: 'liga';
}

// UI
.controls,
.controls * {
box-sizing: border-box;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.controls__header {
z-index: 1;
position: fixed;
top: 0;
left: 0;
right: 0;
background: $white;
border-bottom: 1px solid $black;
height: $component-x;

nav ul {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: $component-x;

li {
display: flex;

&:nth-child(2) {
flex: 1;
}

.nav__button {
padding: 0 3px;
transition: color 100ms ease;

&:hover {
color: $violet;
}
}
}
}
}

.controls__sidebar {
z-index: 1;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-weight: 400;
font-size: 14px;

ol,
ul,
dl {
dt {
text-transform: capitalize;
}

dd {
padding: 5px 0 0 calc(#{$component-x} / 2);
}

li,
dt {
padding: calc(#{$component-x} / 2) 0 0 calc(#{$component-x} / 2);

a {
text-decoration: none;
color: $black;
transition: color 100ms ease;

&:hover {
color: $violet;
}
}
}
}
}


.controls__sidebar__chapters {
position: fixed;
top: $component-y;
height: 100vh;
background: $white;
border-right: 1px solid $black;
width: calc(#{$component-x} * 10);
transition: transform 300ms ease;
transform: translateX(-100%);
overflow: auto;
-webkit-overflow-scrolling: touch;

&.controls__sidebar__chapters--open {
transform: translateX(0);
}
}


.controls__sidebar__metadata,
.controls__sidebar__downloads,
.controls__sidebar__settings {
position: fixed;
top: $component-y;
right: 0;
height: 100vh;
background: $white;
border-left: 1px solid $black;
width: calc(#{$component-x} * 10);
transition: transform 300ms ease;
transform: translateX(100%);
overflow: auto;
-webkit-overflow-scrolling: touch;

&.controls__sidebar__metadata--open,
&.controls__sidebar__downloads--open,
&.controls__sidebar__settings--open {
transform: translateX(0);
}
}


.controls__footer {
z-index: 1;
position: fixed;
left: 0;
right: 0;
bottom: 0;
background: $white;
height: $component-x;

nav ul {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: $component-x;

li {
display: flex;

&:nth-child(2) {
flex: 1;
}

.nav__button {
padding: 0 3px;
transition: color 100ms ease;

:hover {
color: $violet;
}
}
}
}
}

@keyframes spin {
0% {transform: rotate(0deg);}
100% {transform: rotate(360deg);}
}

.spinner {
width: 100vw;
height: 100vh;
position: fixed;
display: none;
background: $white;

.spinner--visible {
display: block;
}

.spinner__detail {
position: absolute;
width: 30px;
height: 30px;
top: calc(50% - 15px);
left: calc(50% - 15px);
border-width: 1px;
border-radius: 50%;
border-style: solid;
border-top-color: transparent;
border-right-color: $black;
border-bottom-color: $black;
border-left-color: $black;
animation: spin 1s infinite linear;
}
}
Loading