Skip to content

Commit

Permalink
Make z-index configurable from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
olipo186 committed Jul 1, 2019
1 parent 55e2edf commit cd2d171
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/BlockInsert.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ class BlockInsert extends React.Component<Props, State> {
const Trigger = styled.div`
position: absolute;
z-index: 199; /* must be below toolbar index */
z-index: ${props => {
return props.theme.zIndex + 99;
}}; /* must be below toolbar index */
opacity: 0;
background-color: ${props => props.theme.background};
transition: opacity 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
Expand Down
4 changes: 3 additions & 1 deletion src/components/Contents.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ const Wrapper = styled.div`
position: fixed;
right: 0;
top: 150px;
z-index: 100;
z-index: ${props => {
return props.theme.zIndex;
}};
@media print {
display: none;
Expand Down
4 changes: 3 additions & 1 deletion src/components/CopyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const StyledCopyToClipboard = styled(CopyToClipboard)`
opacity: 0;
transition: opacity 50ms ease-in-out;
z-index: 199; /* must be below toolbar index */
z-index: ${props => {
return props.theme.zIndex + 99;
}}; /* must be below toolbar index */
font-size: 12px;
font-weight: 500;
color: ${props => props.theme.text};
Expand Down
4 changes: 3 additions & 1 deletion src/components/Toolbar/BlockToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ const Separator = styled.div`

const Bar = styled.div`
display: flex;
z-index: 100;
z-index: ${props => {
return props.theme.zIndex;
}};
position: relative;
align-items: center;
background: ${props => props.theme.blockToolbarBackground};
Expand Down
4 changes: 3 additions & 1 deletion src/components/Toolbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export default class Toolbar extends React.Component<Props, State> {
export const Menu = styled.div`
padding: 8px 16px;
position: absolute;
z-index: 200;
z-index: ${props => {
return props.theme.zIndex + 100;
}};
top: -10000px;
left: -10000px;
opacity: 0;
Expand Down
1 change: 1 addition & 0 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const base = {
fontFamilyMono:
"'SFMono-Regular',Consolas,'Liberation Mono', Menlo, Courier,monospace",
fontWeight: 400,
zIndex: 100,
link: colors.primary,
placeholder: "#B1BECC",
textSecondary: "#4E5C6E",
Expand Down

0 comments on commit cd2d171

Please sign in to comment.