-
Install Styled Components
npm i --save-dev styled-components
-
Set the desired theme
import { ThemeProvider } from "styled-components"; import { themes } from "@aleph-front/core"; function App() { return ( <ThemeProvider theme={themes.aleph}> <div>...</div> <ThemeProvider /> );
-
Start using the Components
import { ThemeProvider } from "styled-components"; import { themes, Logo } from "@aleph-front/core"; function App() { return ( <ThemeProvider theme={themes.aleph}> <Logo text="Node Metrics" /> </ThemeProvider> ); }
See all components in the StoryBook
Before start, obtain a valid package token and set the env var FONTAWESOME_NPM_AUTH_TOKEN
Follow this guide for configuring your local npm config
- Using
aleph-core
withNext.js
framework:- Problems with css
@import
syntaxis. You will need to manually import the font-face css from an url via<link>
html element, or by creating afont.css
that will contain the@import
statement and will be imported from the_app.tsx
Next.js file - Problems with font awesome stylesheet. Follow this guide to solve it: https://fontawesome.com/docs/web/use-with/react/use-with#next-js
- Problems with css
Follow this guide: https://github.com/ben-rogerson/twin.examples/tree/master/next-styled-components-typescript#getting-started