Skip to content

Add styling to designer notes #1150

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

Merged
merged 1 commit into from
Mar 24, 2017
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
13 changes: 13 additions & 0 deletions demo/views/common/information-styles/information-styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

/**
* Wraps children in styling wrapper
*
* @param {object} props
* @return {InformationStyled}
*/
export default props => (
<div className='demo-information-styles'>
{ props.children }
</div>
);
18 changes: 18 additions & 0 deletions demo/views/common/information-styles/information-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@import 'colors';

.demo-information-styles {
a {
color: $blue;
font-weight: bold;
text-decoration: none;

&:hover {
color: $blue-dark;
text-decoration: underline;
}
}

li {
line-height: 20px;
}
}
4 changes: 4 additions & 0 deletions demo/views/common/information-styles/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"main": "./information-styles.js",
"style": "./information-styles.scss"
}
2 changes: 1 addition & 1 deletion demo/views/common/page-content-area/page-content-area.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import SimpleHeading from './../../../components/simple-heading';
* @return {PageContentArea}
*/
export default props => (
<section className='demo-page-content-area'>
<section className={ classNames(props.className, 'demo-page-content-area') }>
<SimpleHeading title={ props.title } link={ props.link } />
<div className='demo-page-content-area__content'>
{ props.children }
Expand Down
5 changes: 4 additions & 1 deletion demo/views/pages/component/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import I18n from 'i18n-js';

// App Components
import PageContentArea from '../../common/page-content-area';
import InformationStyles from '../../common/information-styles';
import ComponentPreview from './component-preview';
import ComponentAPI from './component-api';

Expand Down Expand Up @@ -35,7 +36,9 @@ class Component extends React.Component {
if (designerNotes) {
return (
<PageContentArea title={ I18n.t('component_page.design_notes') }>
<div dangerouslySetInnerHTML={{ __html: marked(designerNotes) }} />
<InformationStyles>
<div dangerouslySetInnerHTML={{ __html: marked(designerNotes) }} />
</InformationStyles>
</PageContentArea>
);
} else {
Expand Down
29 changes: 16 additions & 13 deletions demo/views/pages/document/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import DocumentStore from './../../../stores/document';
import DocumentActions from './../../../actions/document';
import marked from 'marked';
import InformationStyles from '../../common/information-styles';
import Spinner from 'components/spinner';
import Row from 'components/row';
import Highlight from 'react-highlight';
Expand Down Expand Up @@ -53,20 +54,22 @@ class Document extends React.Component {
}

return (
<div className="demo-document">
{ content }
<InformationStyles>
<div className="demo-document">
{ content }

<ReactCSSTransitionGroup
className={ this.loadingClasses() }
transitionName="demo-document__loading"
transitionAppear={ true }
transitionAppearTimeout={ 300 }
transitionEnterTimeout={ 300 }
transitionLeaveTimeout={ 0 }
>
{ spinner }
</ReactCSSTransitionGroup>
</div>
<ReactCSSTransitionGroup
className={ this.loadingClasses() }
transitionName="demo-document__loading"
transitionAppear={ true }
transitionAppearTimeout={ 300 }
transitionEnterTimeout={ 300 }
transitionLeaveTimeout={ 0 }
>
{ spinner }
</ReactCSSTransitionGroup>
</div>
</InformationStyles>
);
}
}
Expand Down
11 changes: 0 additions & 11 deletions demo/views/pages/document/document.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ $doc-animation: opacity 100ms 200ms ease-in;
}
}

a {
color: $blue;
font-weight: bold;
text-decoration: none;

&:hover {
color: $blue-dark;
text-decoration: underline;
}
}

code {
background-color: $grey-dark-blue-15;
border-radius: 4px;
Expand Down