Skip to content

Commit 1f724b8

Browse files
committed
chore: use to ensure styles remain the same
1 parent 8449211 commit 1f724b8

File tree

2 files changed

+9
-20
lines changed

2 files changed

+9
-20
lines changed

gatsby-ssr.js

-15
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@
77
// This is needed to ensure the NR1 SDK can load properly
88
const React = require('react');
99

10-
const sdkStyleOverrides = `
11-
html {
12-
line-height: 1.15;
13-
}
14-
15-
body {
16-
font-size: 16px;
17-
line-height: 1.2;
18-
color: var(--color-black);
19-
}
20-
`;
21-
2210
exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => {
2311
replaceHeadComponents([
2412
...getHeadComponents(),
@@ -47,8 +35,5 @@ exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => {
4735
crossOrigin="anonymous"
4836
src="//nr1.nr-assets.net/lib/d3/3.5.17/d3.js"
4937
/>,
50-
<style key="sdk-overrides" id="sdk-overrides">
51-
{sdkStyleOverrides}
52-
</style>,
5338
]);
5439
};

src/components/styles.scss

+9-5
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,21 @@
5151
/*-- Reset --*/
5252
// https://github.com/necolas/normalize.css
5353
html {
54-
line-height: 1.15;
54+
line-height: 1.15 !important; // Prevent the SDK from overridding this value
5555
-webkit-text-size-adjust: 100%;
5656
}
5757

5858
body {
5959
margin: 0;
60-
font-size: 16px;
61-
font-family: var(--primary-font-family);
62-
color: var(--color-black);
60+
font-size: 16px !important; // Prevent the SDK from overridding this value
61+
font-family: var(
62+
--primary-font-family
63+
) !important; // Prevent the SDK from overridding this value
64+
color: var(
65+
--color-black
66+
) !important; // Prevent the SDK from overridding this value
6367
background-color: var(--color-white);
64-
line-height: 1.2;
68+
line-height: 1.2 !important; // Prevent the SDK from overridding this value
6569
}
6670

6771
main {

0 commit comments

Comments
 (0)