Skip to content

Update path styling, including responsive #178

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
Jul 17, 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
1 change: 1 addition & 0 deletions docs/demo/demo.b13313c0a7d166929de3.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/demo/demo.d73ff4397f0035ac6394.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body><script type="text/javascript" src="manifest.81c1f8c28d950ee22175.js"></script><script type="text/javascript" src="vendor.5e42313e188f293e0550.js"></script><script type="text/javascript" src="demo.d73ff4397f0035ac6394.js"></script></body>
<body><script type="text/javascript" src="manifest.5c1a17bfabe9dba82773.js"></script><script type="text/javascript" src="vendor.5e42313e188f293e0550.js"></script><script type="text/javascript" src="demo.b13313c0a7d166929de3.js"></script></body>
</html>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/components/BodySchema/BodySchema.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export const styles = createSheet(({ backgrounds, borders, sizes }) => ({
borderLeft: `1px solid ${borders.default}`
},

[`& > td > table`]: {
marginLeft: '12px'
},

[`.${property.classes.last} + & > td`]: {
borderLeft: 'none'
}
Expand All @@ -43,13 +47,14 @@ export const styles = createSheet(({ backgrounds, borders, sizes }) => ({
fontFamily: 'monospace',
padding: '5px 10px'
},

'hasTabs': {
borderTopLeftRadius: 0
},

[`@media (max-width: ${sizes.breakpoint})`]: {
'bodySchema': {
paddingRight: '10px',
paddingRight: '22px',
fontSize: '0.8rem'
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Endpoints/Endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class Endpoint extends PureComponent {

return (
<div className={classes.endpoint}>
{description && <div><label>{description}</label></div>}
{description && <div>{description}</div>}
<input className={classes.readonly} defaultValue={url} readOnly onFocus={this.handleFocus} />
</div>
)
Expand Down
10 changes: 9 additions & 1 deletion src/components/Endpoints/Endpoint.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@ import { createSheet } from '../../theme'

export const styles = createSheet(({borders, text, sizes}) => ({
endpoint: {
lineHeight: '200%'
lineHeight: '1.4',
'& + &': {
marginTop: '.5rem'
}
},
readonly: {
fontSize: '.8rem',
fontFamily: 'monospace',
lineHeight: '1.4',
padding: '.25rem',
width: '100%',
boxSizing: 'border-box',
'&:focus': {
outline: 'none'
}
Expand Down
15 changes: 12 additions & 3 deletions src/components/Endpoints/Endpoints.style.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ import c from 'color'

export const styles = createSheet(({borders, backgrounds, text, sizes}) => ({
endpoints: {
minWidth: '300px',
backgroundColor: `${c(backgrounds.schema).darken(0.1)}`,
padding: '15px'
minWidth: '30rem',
backgroundColor: `${c(backgrounds.schema)}`,
padding: '.5rem',
boxShadow: '2px 2px 1rem rgba(0,0,0,0.25)',
borderRadius: '.5rem'
},

[`@media (max-width: ${sizes.breakpoint})`]: {
'endpoints': {
minWidth: 'auto',
width: '100%'
}
}
}))
4 changes: 4 additions & 0 deletions src/components/Indicator/Indicator.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export const styles = createSheet(({ shades }) => ({
marginLeft: '1em'
},

'&:hover': {
cursor: 'pointer'
},

'&$up img': { transform: 'rotate(180deg)' },
'&$right img': { transform: 'rotate(-90deg)' }
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/Method/Method.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ export const styles = createSheet(({ borders, text, sizes }) => ({

'& > h3': {
display: 'inline-block',
marginBottom: '15px'
margin: '0 1.5rem .5rem 0'
},

'& h4': {
fontSize: 'smaller',
textTransform: 'uppercase',
color: `${c(text.default).lighten(0.5)}`,
borderBottom: `1px solid ${borders.default}`,
marginTop: '20px'
marginTop: '1rem'
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/components/Method/MethodEndpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class MethodEndpoints extends PureComponent {
}

return (
<div className={classNames(classes.methodPath)}>
<div className={classNames(classes.methodEndpoints)}>
<div onClick={this.onClickPath}>
<span className={classNames(type, 'methodType')}>{type}</span>
<span className='path'>{path}</span>
Expand Down
23 changes: 19 additions & 4 deletions src/components/Method/MethodEndpoints.styles.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { createSheet } from '../../theme'

export const styles = createSheet(({borders, text, sizes}) => ({
methodPath: {
methodEndpoints: {
display: 'inline-block',
fontFamily: 'monospace',
marginLeft: '30px',
fontSize: '1.2rem',
margin: '0 0 .5rem',
position: 'relative',

'&:hover': {
textDecoration: 'underline'
},

'& .methodType': {
textTransform: 'uppercase',
marginRight: '10px',
Expand All @@ -31,9 +36,19 @@ export const styles = createSheet(({borders, text, sizes}) => ({
display: 'none'
},
expanded: {
// outline: '1px solid red',
display: 'block',
position: 'absolute',
backgroundColor: 'white'
top: '1.6rem',
left: '0',
zIndex: '5'
},

[`@media (max-width: ${sizes.breakpoint})`]: {
'methodEndpoints': {
display: 'block'
},
expanded: {
width: 'calc(100% - 1rem)'
}
}
}))