Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@consid/theme

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@consid/theme

Official Consid MUI theme for #nextlevel Consid apps

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
3
Weekly downloads
 
Created
Source

Official Consid MUI theme

Official Consid theme for #nextlevel consid apps. Use this as a starting point for your next consid branded app.

Demo

Installation

This is just a theme for the MUI Material design system. You'll need to install MUI Material according to their guides.

npm i @consid/theme @mui/material @emotion/react @emotion/styled

Add the theme to MUI

Wrap your application with MUI's ThemeProvider

import theme from "@consid/theme";
import { ThemeProvider } from "@mui/material/styles";

export default function Main() {
  return (
    <ThemeProvider theme={theme}>
      <YourApp />
    </ThemeProvider>
  );
}

Fonts

Consid uses the Google Font "Plus Jakarta Sans" and so does this theme. You'll need to install the font in your preffered way. The themes calls for a font with the family name Plus Jakarta Sans.

Example: npm install @fontsource/plus-jakarta-sans

You might need to merge the font into the current theme. Depending on how you install the theme. For example with next/font in next.js:

// lib/themeWithFont.ts
"use client";

import { deepmerge } from "@mui/utils";
import { createTheme, ThemeOptions } from "@mui/material/styles";
import theme from "@consid/theme";
import { Plus_Jakarta_Sans } from "next/font/google";

const jakarta = Plus_Jakarta_Sans({ subsets: ["latin"], display: "swap", style: ["normal"] });

const fontTheme: ThemeOptions = {
  typography: {
    fontFamily: jakarta.style.fontFamily,
  },
};

const themeWithFont = createTheme(deepmerge(theme, fontTheme));

export default themeWithFont;

Server Side Rendering

Using something like next.js? MUI needs to render all the styles on the server aswell. There are built in packages to handle this. Read the official MUI documentation. Example for the next.js app-router:

npm install @mui/material-nextjs @emotion/cache

// layout.tsx
import { AppRouterCacheProvider } from "@mui/material-nextjs/v13-appRouter";
import { ThemeProvider } from "@mui/material/styles";
import theme from "@consid/theme";

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <AppRouterCacheProvider>
        <ThemeProvider theme={theme}>
          <body>{children}</body>
        </ThemeProvider>
      </AppRouterCacheProvider>
    </html>
  );
}

FAQs

Package last updated on 11 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc