Skip to content

Commit

Permalink
Add elementInvisible to Tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieux51 committed May 1, 2020
1 parent 1998fbf commit 92d7d32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Tooltip.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react"
import styled from "styled-components"
import elementInvisible from "../style/elementInvisible"

const Right = styled.span`
width: 70vw;
Expand All @@ -24,8 +25,7 @@ const Container = styled.div`
position: relative;
text-align: left;
& ${Right} {
visibility: ${(props) => (props.isVisible ? "visible" : "hidden")};
opacity: ${(props) => (props.isVisible ? 1 : 0)};
${(props) => (props.isVisible ? "" : elementInvisible)};
}
`

Expand Down
12 changes: 12 additions & 0 deletions src/style/elementInvisible.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { css } from "styled-components"

const elementInvisible = css`
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
`

export default elementInvisible

0 comments on commit 92d7d32

Please sign in to comment.