Altering or including new space variables within a custom Chakra-ui theme

Looking to customize spacing variables in a Chakra UI theme?

I have successfully implemented various extensions, but changes to spacing are not being applied.

const config: ThemeConfig = {
  initialColorMode: 'light',
  useSystemColorMode: false,
}
const myNewTheme = {
  styles: {
    global: {
      body: {
        bg: 'bgLight',
      },
    },
  },
  colors,
  fonts: {
    body: 'Bitter, serif',
    heading: 'Poppins, sans-serif',
  },
  fontSizes: {
    vw1: 'calc(max(16vw, 2rem))',
  },

  space: {
    spacing: {
      96: '28rem',
     112: '32rem'
    },
  },
  breakpoints,
  components: {
    Button,
    Heading,
  },
}

const fsiTheme = extendTheme(myNewTheme, { config })

export default fsiTheme

I also attempted the following:

spacing: {
    space: {
      96: '28rem',
      112:'32rem'
    },
  },

Answer №1

The individuals from Chakra graciously offered their assistance. In case anyone else encounters this issue, the solution is to enhance the theme by adding some space.

const customTheme = {
  space: {
      96: '28rem',
     112: '32rem'
    },
}

const updatedTheme = extendTheme(customTheme)

export default updatedTheme

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Instead of showing the data in the variable "ionic", there is a display of "[object object]"

Here is the code snippet I'm working with: this.facebook.login(['email', 'public_profile']).then((response: FacebookLoginResponse) => { this.facebook.api('me?fields=id,name,email,first_name,picture.width(720).height( ...

Prisma: Utilizing the include option will retrieve exclusively the subobject fields

I created a function to filter the table building and optionally pass a Prisma.BuildingInclude object to return subobjects. async describeEntity(filter: Filter, include?: Prisma.BuildingInclude): Promise<CCResponse> { try { const entity = await ...

Learn the art of generating multiple dynamic functions with return values and executing them concurrently

I am currently working on a project where I need to dynamically create multiple functions and run them in parallel. My starting point is an array that contains several strings, each of which will be used as input for the functions. The number of functions ...

Implementing MemberStack for user authentication within a Next.js application by leveraging the functionalities of NextAuth.js

In my current Next.js app with NextAuth.js, I am utilizing MemberStack for authentication. While it may not have been my top choice of tools initially, I am transitioning from a Webflow site that already uses MemberStack for auth. The new site I'm bui ...

What is the proper syntax for using .focus() with the nextElementSibling method in typing?

As I strive to programmatically shift focus in my form using nextElementSibling, I encounter a challenge with typing variables/constants due to working with Typescript... I have managed to achieve success without typing by implementing the following: myF ...

Testing Angular2 / TypeScript HTTPService without Mocking: A Guide

import {Injectable} from '@angular/core'; import {Http} from '@angular/http'; @Injectable() export class HttpService { result: any; constructor(private http:Http) { } public postRequest(){ return this.http.get('h ...

Enhancements to a NativeScript Application

After running some tests on my NativeScript app following the steps outlined here - , I found that it takes 18 seconds for the program to start and for a user to log in. Is this considered acceptable performance? Appreciate any feedback provided! ...

Prevent Next.js 13 from caching Firebase response or query result

I've created an API route located at: app/api/notes/route.js import db from "@/utils/firebaseDB" import { collection, getDocs } from "firebase/firestore"; export const GET = async (request) => { let posts = [] try { ...

Unable to modify font weight - Choose Ant Design Select Component

I'm new to programming and I'm working on creating a select component using ant-design. However, I am facing an issue where I cannot change the font-weight within ant-design. The component seems to accept all other properties that are passed exce ...

AWS Amplify is causing issues by returning undefined when attempting to access environment variables

My nextjs application is being launched via AWS Amplify, but I'm encountering an issue with an environment variable returning undefined when called in my node application. The environment variable in question, named STRAPI, is a 256-character string ...

Supporting wildcard redirect URLs for Vercel in Asp .Net Identity Server

Currently, I am working with Duende IdentityServer for my back-end RestApi and using Vercel to test the front-end. However, I am facing an issue where I cannot login to IdentityServer with Vercel due to the redirectUrl not being allowed. I have come acros ...

The TypeScript declarations for the scss module are malfunctioning

Just recently, I set up a React project using rollup. Below is the configuration file for my rollup setup: rollup.config.js import serve from "rollup-plugin-serve"; import livereload from "rollup-plugin-livereload"; import babel from &q ...

What is the best method to publish my npm package so that it can be easily accessed through JSDelivr by users?

I've been working on creating an NPM package in TypeScript for educational purposes. I have set up my parcel configuration to export both an ESM build and a CJS build. After publishing it on npm, I have successfully installed and used it in both ESM-m ...

Unable to run `create-react-app` with the `--template typescript` option

Every time I try to execute the following command: npx create-react-app my-app --template typescript only a JavaScript project is created, without any .tsx files. After consulting the CRA's TypeScript guide, it appears that the command requires Node ...

Tips for utilizing setState to display specific information fetched from an API call through the mapping method

Is there a way to utilize setState in order to render individual data retrieved from an API call? Despite my efforts, all I seem to get is another array of data. Here's the code snippet: const [likes, setLikes] = useState(0); useEffect( async () = ...

Encountering the error message "Module not found: '@next/env'" during Vercel deployment

I've been struggling with this error for a while now... View Screenshot from Vercel I have a .env file in my main directory. Since I am new to web deployment, I wasn't entirely sure about what should go into the .env file. One thing that confused ...

PWA Update: The FetchEvent for "<URL>" encountered a network error response - the promise has been denied

Encountering error messages in the console of my Progressive Web App (PWA): The FetchEvent for "https://static.cloudflareinsights.com/beacon.min.js" resulted in a network error response: the promise was rejected. The FetchEvent for "https:/ ...

Is app.component.ts necessary in an Angular 2 project?

Currently diving into Angular 2 and have a burning question on my mind. Do I really need the app.component.ts file in my project? Each of my folders has its own component and template, so I'm debating if the main component is necessary or if I can rem ...

Optimizing image centering in Next JS as screen size expands

I've been struggling to work with NextJS's Image component. My goal is to set up a banner image that only covers a specific amount of space on the screen, regardless of screen size. I have managed to achieve this by using max-height: 30vh and ov ...

You cannot utilize Lesson as a JSX Component in Next JS TypeScript

Below is my updated page.tsx code: import Aspects from '@/components/Aspects'; import FreeForm from '@/components/FreeForm'; import Lesson from '@/components/Lesson'; import React from 'react'; import { Route, Route ...