Skip to content

Commit

Permalink
Reverted back Open sans import due to issues with globalStyles
Browse files Browse the repository at this point in the history
  • Loading branch information
Jialecl committed May 21, 2024
1 parent 66c6f2c commit a3aa219
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/src/HalstackContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useMemo } from "react";
import Color from "color";
import { createGlobalStyle } from "styled-components";
import styled from "styled-components";
import {
AdvancedTheme,
OpinionatedTheme,
Expand Down Expand Up @@ -395,19 +395,20 @@ type HalstackProviderPropsType = {
const HalstackProvider = ({ theme, advancedTheme, labels, children }: HalstackProviderPropsType): JSX.Element => {
const parsedTheme = useMemo(
() => (theme ? parseTheme(theme) : advancedTheme ? parseAdvancedTheme(advancedTheme) : componentTokens),
[theme, advancedTheme],
[theme, advancedTheme]
);
const parsedLabels = useMemo(() => (labels ? parseLabels(labels) : defaultTranslatedComponentLabels), [labels]);

return (
<HalstackContext.Provider value={parsedTheme}>
<GlobalStyle />
<HalstackLanguageContext.Provider value={parsedLabels}>{children}</HalstackLanguageContext.Provider>
</HalstackContext.Provider>
<Halstack>
<HalstackContext.Provider value={parsedTheme}>
<HalstackLanguageContext.Provider value={parsedLabels}>{children}</HalstackLanguageContext.Provider>
</HalstackContext.Provider>
</Halstack>
);
};

const GlobalStyle = createGlobalStyle`
const Halstack = styled.div`
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800&display=swap");
`;

Expand Down

0 comments on commit a3aa219

Please sign in to comment.