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

TS2688 Error: Type definition file for 'keyv' is missing

The automated code build process failed last night, even though I did not make any changes related to NPM libraries. The error message I received was: ERROR TS2688: Cannot find type definition file for 'keyv'. The file is in the program because: ...

Creating a nested observable in Angular2: A step-by-step guide

Currently, I am exploring a new approach in my Angular2 service that involves using observables. The data source for this service will initially be local storage and later updated when an HTTP call to a database returns. To achieve this dynamic updating of ...

Using the js-cookie library in a TypeScript-based project: A guide

Looking to incorporate the js-cookie library into my TypeScript project. After installing the library and typings with the command npm install js-cookie @types/js-cookie --save-dev in the location containing node_modules and package.json, my package.json ...

Using an AWS API Gateway, an HTTP client sends a request to access resources

I have a frontend application built with Angular and TypeScript where I need to make an HTTP request to an AWS API Gateway. The challenge is converting the existing JavaScript code into TypeScript and successfully sending the HTTP request. The AWS API gat ...

Guide to renewing the service worker using next-pwa

I have integrated the next-pwa package into my next.js application for PWA functionalities. However, I am encountering a problem where the service worker does not re-register after rebuilding and redeploying the application. This results in outdated data ...

When trying to compile FirebaseUI with typescript and react-redux, users may encounter issues

I'm attempting to implement firebaseui for a login feature in react-redux using typescript. Here is the code snippet: import firebase from 'firebase'; import firebaseui from 'firebaseui'; import fire from '../FirebaseCreds&ap ...

Using SVG Inline Style Conditionals in ReactJS

Would you say I have the conditional inline code set up correctly in this instance? The SVG icon is currently an x sign, but I want it to toggle to display a + sign. <svg viewBox='0 0 26 26' focusable='true' style={toggleShow ? { tra ...

What is the process for obtaining the directory path in a Next.js project that has been deployed to Vercel?

In my Next.js project, I have implemented internationalization using Fluent (). The localization data is stored in .ftl files within the locales directory. This is the abstract structure of my project: my-app/ ├─ src/ │ ├─ app/ │ ├─ loca ...

Uploading images using Angular and PHP: A comprehensive guide

I am a beginner in Angular and I am having trouble uploading an image from Angular as I encounter 4 errors: 1) Error in the post method: Cannot find name 'formData'. Did you mean 'FormData'?ts(2552) 2) Error in the subscribe method: ...

Utilizing the Pub/Sub architecture to integrate the kafka-node library within Node Js

Utilizing the kafka-node module in my NodeJs Microservise project, I am aiming to implement a Pub/Sub (publisher and subscriber) design pattern within the Functional programming paradigm. producer.js const client = new kafka.KafkaClient({ kafkaHost: ...

Angular rxjs Distinctions

Coming from AngularJS to Angular, I'm still trying to wrap my head around rxjs observable. For example: User.ts export class User { id?:any; username:string; password:string; } Using <User[]> myUser(header: any) { const url = `${this.mainUr ...

Is it necessary to use both observer.unobserve and observer.disconnect at the same time?

Is it unnecessary to use both observer.unobserve and observer.disconnect together? Should I just stick with one of them? I have implemented the IntersectionObserver within a useEffect. The code snippet provided is the clean-up function for that useEffect. ...

What is the process for designating the TypeScript server side entry point in a "Nuxt TypeScript" project?

In my experience with a JavaScript-based Nuxt project, the server entry is located in server/index.js. Here is the default code for Express.js: const express = require('express') const consola = require('consola') const { Nuxt, Builder ...

Using React Native to dynamically change color based on API response

I'm currently working on a React Native project and I have a requirement to dynamically change the background color of a styled component based on the value retrieved from an API. However, I'm facing some challenges in implementing this feature. ...

A Promise signature allows for the compilation of function bodies that return undefined

The compiler error that I expected to see when using this function does not actually occur. The function body is capable of returning undefined, yet the type signature does not mention this possibility. async function chat(_: at.ChatLine): Promise<Arr ...

Implementing Django with Next JS

I have created a Django + Next JS website and I am now looking to deploy it. I am unsure whether to choose a hosting server or a VPS. The website is simple, static, and serves as a kind of catalogue. It's worth noting that the default homepage for Nex ...

What is the best way to restrict the input year on @mui/x-date-pickers to a certain range?

Is there a way to restrict the input year range when using @mui/x-date-pickers? I want to limit it from 1000 to 2023 instead of being able to enter years like 0000 or 9999. https://i.stack.imgur.com/0p6j3.jpg I have tried adding a mask to InputProps in my ...

TypeScript overloading error: Anticipated 0 parameters, received 2 instead

I am facing an issue with a class containing an overloaded method that has two versions. One version does not take any arguments, while the second one can take two arguments. class DFD { ... getEndDatetime(): string; getEndDatetime(startTime?: ...

Struggling to align a section in the middle of an image in next.js

Hello everyone, I'm new to using Next.js. Currently, I have the HomePage located within the pages folder. My issue is that I am attempting to center the <h1></h1> in the middle of the picture but instead, it keeps pushing it down. Below is ...

What is the best way to configure the default entry point for a package.json file in a React

I'm having trouble with the default export in my package.json file. when I try to import: import { Component } from 'packagename/'; // size 22kb or import { Component } from 'packagename/dist' // size 22kb; but import { Component ...