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

fix: set viewport to 100%; clean up docs styles a bit #312

Merged
merged 1 commit into from
Jan 28, 2019
Merged
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
2 changes: 1 addition & 1 deletion src/_playground/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, { Component } from 'react';
class App extends Component {
render() {
return (
<div className='App'>
<div className='frDocs-App'>
<Routes />
</div>
);
Expand Down
188 changes: 92 additions & 96 deletions src/_playground/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,101 @@ $fd-icons-path: '../../node_modules/fiori-fundamentals/scss/icons/';
$fd-fonts-path: '../../node_modules/fiori-fundamentals/dist/fonts/';
@import '../../node_modules/fiori-fundamentals/scss/all.scss';

.App {
// Fundamental React Docs Styles
.frDocs-App {
background-color: white;

.frDocs-Container {
display: flex;
justify-content: space-between;
height: 100vh;
overflow: hidden;
margin-left: auto;
margin-right: auto;
width: 100%;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actual fix is here.


.frDocs-Sidebar {
color: #21262c;
min-width: 16rem;
background-color: #f1f3f6;

.frDocs-Logo {
font-size: 1.25rem;
margin-bottom: 0;
display: flex;
justify-content: center;
> a {
color: inherit;
}
}

.frDocs-Nav {
list-style: none;
border-top: 2px solid #dbe7f3;
height: 90%;
overflow: auto;

.frDocs-Nav__headers {
color: #424e5a;
padding: 15px 20px;
display: block;
}

.frDocs-Nav__item {
display: block;
color: #21262c;
font-size: 0.875rem;
position: relative;
padding: 13px 40px;
}

.frDocs-Nav__item--selected {
border-left: 6px solid #2fd0c8;
}

.frDocs-Nav__item:hover,
.frDocs-Nav__item--active {
color: #424e5a;
border-left: 6px solid #2fd0c8;
padding-left: 34px;
}
}
}

.frDocs-Content {
flex-grow: 1;
overflow-y: scroll;
padding-bottom: 2rem;
background-color: white;
margin-right: auto;
margin-left: auto;
padding-left: 1rem;
padding-right: 1rem;

.frDocs-Content__header {
margin: 12px 0;
margin-top: 2rem;
font-size: 2.2rem;
}

.frDocs-Content__description {
margin-bottom: 1.5rem;
font-size: 1rem;
font-weight: 300;
}

.frDocs-Content__tile {
border-radius: 4px 4px 0 0;
border: 1px solid #ccc;
border-bottom: none;
padding: 10px 0;
background-color: '#f3f4f5'
}
}
}
}

// Fundamental React Component Overrides
.fd-counter--notification {
position: relative;
}
Expand Down Expand Up @@ -42,104 +133,15 @@ $fd-fonts-path: '../../node_modules/fiori-fundamentals/dist/fonts/';
padding-bottom: 10px;
}

.docs-component {
margin-bottom: -28px;
border-radius: 4px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
padding-bottom: 8px;
border: 1px solid #ccc;
}

.fd-side-nav.fd-side-nav--icons {
max-width: 65px;
}

.container {
display: flex;
justify-content: space-between;
height: 100vh;
overflow: hidden;
width: 90%;
margin-left: auto;
margin-right: auto;
}

.logo {
font-size: 1.25rem;
margin-bottom: 0;
display: flex;
justify-content: center;
> a {
color: inherit;
}
}

.logo-subtitle {
font-size: 0.75rem;
}

.sidebar {
color: #21262c;
min-width: 16rem;
background-color: #f1f3f6;
}

.nav {
list-style: none;
border-top: 2px solid #dbe7f3;
height: 90%;
overflow: auto;
}

.nav-item {
display: block;
color: #21262c;
font-size: 0.875rem;
position: relative;
padding: 13px 40px;
}

.side-nav__headers {
color: #424e5a;
padding: 15px 20px;
display: block;
}

.nav-item--selected {
border-left: 6px solid #2fd0c8;
}

.nav-item:hover,
.nav-item--active {
color: #424e5a;
border-left: 6px solid #2fd0c8;
padding-left: 34px;
}

.content {
flex-grow: 1;
overflow-y: scroll;
padding-bottom: 2rem;
background-color: white;
}

.content-margin {
margin-right: auto;
margin-left: auto;
padding-left: 1rem;
padding-right: 1rem;
}

.property-header {
text-align: left;
padding-right: 15px;
}

.header {
margin: 12px 0;
}

.fd-side-nav {
max-width: 250px;
}
Expand Down Expand Up @@ -251,9 +253,3 @@ $fd-fonts-path: '../../node_modules/fiori-fundamentals/dist/fonts/';
}
}
}

.description {
margin-bottom: 1.5rem;
font-size: 1rem;
font-weight: 300;
}
44 changes: 21 additions & 23 deletions src/_playground/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,16 @@ export default class Routes extends Component {
render() {
return (
<BrowserRouter basename={process.env.PUBLIC_URL}>
<div className='container'>
<div className='sidebar'>
<h1 className='logo'>FUNDAMENTAL REACT</h1>
<ul className='nav'>
<li className='side-nav__headers'>Components</li>
<div className='frDocs-Container'>
<div className='frDocs-Sidebar'>
<h1 className='frDocs-Logo'>FUNDAMENTAL REACT</h1>
<ul className='frDocs-Nav'>
<li className='frDocs-Nav__headers'>Components</li>
{this.state.routes.map(route => {
return (
<NavLink
activeClassName='nav-item--active'
className='nav-item'
activeClassName='frDocs-Nav__item--active'
className='frDocs-Nav__item'
key={route.url}
to={{ pathname: route.url }}>
{route.name}
Expand All @@ -169,22 +169,20 @@ export default class Routes extends Component {
})}
</ul>
</div>
<div className='content'>
<div className='content-margin'>
<Switch>
{this.state.routes.map(route => {
return (
<Route
component={route.component}
exact
key={route.url}
path={route.url} />
);
})}
<Redirect exact from=''
to='/actionBar' />
</Switch>
</div>
<div className='frDocs-Content'>
<Switch>
{this.state.routes.map(route => {
return (
<Route
component={route.component}
exact
key={route.url}
path={route.url} />
);
})}
<Redirect exact from=''
to='/actionBar' />
</Switch>
</div>
</div>
</BrowserRouter>
Expand Down
2 changes: 1 addition & 1 deletion src/_playground/documentation/Description/Description.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ReactMarkdown from 'react-markdown';

export const Description = ({ children }) => (
<ReactMarkdown
className='description'
className='frDocs-Content__description'
source={children} />
);

Expand Down
9 changes: 1 addition & 8 deletions src/_playground/documentation/DocsTile/DocsTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@ import SyntaxHighlighter from 'react-syntax-highlighter';
import React, { Component } from 'react';

export const DocsTile = props => {
const docsTileStyle = {
borderRadius: '4px 4px 0 0',
border: '1px solid #ccc',
borderBottom: 'none',
padding: '10px 0',
backgroundColor: '#f3f4f5'
};
const centerStyle = {
textAlign: 'center'
};

const {centered, children} = props;

return (
<div className='fd-tile' style={docsTileStyle}>
<div className='frDocs-Content__tile'>
{centered
? (
<div className='fd-tile__content'>
Expand Down
6 changes: 1 addition & 5 deletions src/_playground/documentation/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@ import PropTypes from 'prop-types';
import React from 'react';

export const Header = (props) => {
const headerStyle = {
marginTop: '2rem',
fontSize: '2.2rem'
};
const { children } = props;

return (
<h1 className='header' style={headerStyle}>
<h1 className='frDocs-Content__header'>
{children}
</h1>
);
Expand Down