-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #544 from City-of-Helsinki/UHF-8070-fix-heading-st…
…yles-with-hds UHF-8070: fix heading styles with hds
- Loading branch information
Showing
5 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/js/react/common/hooks/removeHdsNormalizeStyleElementFromDom.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { useLayoutEffect } from 'react'; | ||
|
||
const removeHdsNormalizeStyleElementFromDom = () => { | ||
useLayoutEffect(() => { | ||
const styleElements = document.querySelectorAll('style'); | ||
Object.keys(styleElements).forEach((key: any) => { | ||
if (styleElements[key].innerHTML.startsWith('/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */')) { | ||
styleElements[key].remove(); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
export default removeHdsNormalizeStyleElementFromDom; |