0.2.6 • Published 3 years ago

@tibergroup/groundctrl-global v0.2.6

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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.

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.9

3 years ago