redoc/src/common-elements/tabs.ts

99 lines
1.9 KiB
TypeScript
Raw Normal View History

2018-05-16 12:44:36 +03:00
import { Tabs as ReactTabs, TabsProps } from 'react-tabs';
import styled from '../styled-components';
2017-10-12 00:01:37 +03:00
export { Tab, TabList, TabPanel } from 'react-tabs';
export const Tabs = styled(ReactTabs)`
> ul {
list-style: none;
padding: 0;
margin: 0;
2018-05-28 21:50:26 +03:00
margin: 0 -5px;
2017-10-12 00:01:37 +03:00
> li {
padding: 5px 10px;
display: inline-block;
2018-05-28 21:50:26 +03:00
2017-10-12 00:01:37 +03:00
background-color: rgba(0, 0, 0, 0.2);
2018-01-24 13:32:25 +03:00
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
2017-10-12 00:01:37 +03:00
cursor: pointer;
text-align: center;
outline: none;
2018-01-24 13:32:25 +03:00
color: #ccc;
2018-05-28 21:50:26 +03:00
margin: 5px;
border: 1px solid #181f22;
border-radius: 5px;
min-width: 60px;
font-size: 0.9em;
font-weight: bold;
2017-10-12 00:01:37 +03:00
&.react-tabs__tab--selected {
2018-05-28 21:50:26 +03:00
color: ${props => props.theme.colors.text};
background: #e2e2e2;
2017-10-12 00:01:37 +03:00
}
&:only-child {
flex: none;
min-width: 100px;
}
&.tab-success {
color: ${props => props.theme.colors.success};
}
&.tab-redirect {
color: ${props => props.theme.colors.redirect};
}
&.tab-info {
color: ${props => props.theme.colors.info};
}
&.tab-error {
color: ${props => props.theme.colors.error};
}
}
}
> .react-tabs__tab-panel {
background: #171e21;
& > div,
& > pre {
padding: 20px;
margin: 0;
}
}
`;
export const SmallTabs = Tabs.extend`
2017-10-12 00:01:37 +03:00
> ul {
display: block;
> li {
2018-05-28 21:50:26 +03:00
padding: 2px 5px;
min-width: auto;
margin: 0 15px 0 0;
font-size: 13px;
font-weight: normal;
2017-10-12 00:01:37 +03:00
border-bottom: 1px dashed;
color: #787b7d;
2018-05-28 21:50:26 +03:00
border-radius: 0;
background: none;
2017-10-12 00:01:37 +03:00
&:last-child {
margin-right: 0;
}
&.react-tabs__tab--selected {
color: #babcbf;
2018-05-28 21:50:26 +03:00
background: none;
2017-10-12 00:01:37 +03:00
}
}
}
> .react-tabs__tab-panel {
& > div,
& > pre {
padding: 10px 0;
margin: 0;
}
}
`;