Skip to content

Centralising breakpoints #3035

Closed
Closed
@Keshav-0907

Description

@Keshav-0907

Increasing Access

Having a centralised approach for breakpoints will enhance the code readability, collaboration, and scalability. It will ensure a consistent and efficient approach to handling responsiveness in our project.

Feature enhancement details

The current code appears to be decentralized regarding breakpoints, which may impact maintainability and consistency
By consolidating breakpoints in a dedicated file, we can streamline development, making it easier to manage and update responsive design across the editor.

Approch

Using a centralised breakpoints.js

const breakpoints = {
  mobile: 767,
  tablet: 1024, //  Just for reference, as we don't have distinct breakpoints for tablets now
};

Importing the breakpoints in the components where we need to use media queries.

import breakpoints from './breakpoints';

const aRandomComponent = () => {
  const isMobile = useMediaQuery({ maxWidth: breakpoints.mobile });

  ....
};

I want to work on this issue

Metadata

Metadata

Assignees

Labels

Area: Code QualityFor refactoring, cleanup, or improvements to maintainabilityArea: MobileFor issues affecting mobile or responsive behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions