@tibergroup/groundctrl-global v0.2.6
GroundCTRL Global Files
Global files are used across all the groundCTRL Micro Frontend interfaces and are provided in this npm package to prevent duplicate code across the codebase.
Updating
To update the package, run the build command and then the publish:npm command. Note, on Windows you will need to use Git Bash to run the publish command successfully.
Installation
To install:
npm i @tibergroup/groundctrl-global
Styles
Import into the file where the ThemeProvider and Router are:
import { globalStyles, theme } from "@tibergroup/groundctrl-global";
The ThemeProvider should be set up like:
<ThemeProvider theme={props.theme || theme}>
GlobalStyles are set up using styled-component's createGlobalStyle method:
const GlobalStyle = createGlobalStyle
${globalStyles};
and are added just inside the Router:
<Router>
{window.location.hostname.includes("localhost") && <GlobalStyle />}
...routes
</Router>
We only want to use the GlobalStyle when we are in development. The styles are applied by the parent-container in production.