Skip to content

Commit

Permalink
Merge pull request #301 from roblan/master
Browse files Browse the repository at this point in the history
insert css as first to allow easy css styling without important
  • Loading branch information
aronhelser authored Apr 9, 2018
2 parents 47fa1f4 + efe181a commit 9b8c083
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,12 @@ class ReactTooltip extends React.Component {
* in this way we can insert default css
*/
setStyleHeader () {
if (!document.getElementsByTagName('head')[0].querySelector('style[id="react-tooltip"]')) {
const head = document.getElementsByTagName('head')[0]
if (!head.querySelector('style[id="react-tooltip"]')) {
let tag = document.createElement('style')
tag.id = 'react-tooltip'
tag.innerHTML = cssStyle
document.getElementsByTagName('head')[0].appendChild(tag)
head.insertBefore(tag, head.firstChild)
}
}

Expand Down

0 comments on commit 9b8c083

Please sign in to comment.