Skip to content

Cannot add custom $grid-breakpoints #128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
de1mat opened this issue Jul 15, 2020 · 2 comments
Closed

Cannot add custom $grid-breakpoints #128

de1mat opened this issue Jul 15, 2020 · 2 comments

Comments

@de1mat
Copy link

de1mat commented Jul 15, 2020

I have added another custom breakpoint like so:

$grid-breakpoints: (
	xs:  0,
	sm:  576px,
	md:  768px,
	lg:  992px,
	xl:  1200px,
	xxl: 1450px
) !default;

And it works fine at the SCSS level. But when I try to device a CCol with the xxl size, it does not get added to the generated HTML class output. And the reason is because of the interface for the CCol class which is defined like so...

interface CCol extends HTMLProps<any> {
  children?: ChildElement;
  tag?: any;
  className?: string;
  innerRef?: object | Function | string;
  xs?: columnProps;
  sm?: columnProps;
  md?: columnProps;
  lg?: columnProps;
  xl?: columnProps;
  widths?: Array<any>;
}

So with the xxl={4} being set in JSX, I will get the following output <div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6"> (notice that col-xxl-4 is missing).

But if I use the Inspector to update the DOM and manually add the class name like so ... <div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6 col-xxl-4"> then everything works fine. So it is literally just an issue with CoreUI not allowing col-xxl-? to be passed through.

This kind of defeats the purpose of being able to customise the breakpoints if CoreUI does not allow them to be extended. Not sure what the ultimate solution is, but in the short term is there any chance you could update the TypeScript Interface to allow xxl?: columnProps; to be defined?

In this day and age with ultra large monitors, stopping at xl is just not flexible enough.

@woothu
Copy link

woothu commented Jul 15, 2020

Hi! Thank you for this report!

We have added xxl breakpoint as default in 3.0.6 release. Typings are also changed.

BTW. We will add xxl breakpoint by default to our CSS library in the next version.

Regards!

@de1mat
Copy link
Author

de1mat commented Jul 28, 2020

Thank you so much 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants