Skip to content
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

[Bug]: scss fluid headings not working as expected. #3747

Open
2 tasks done
korgan00 opened this issue Aug 31, 2023 · 9 comments
Open
2 tasks done

[Bug]: scss fluid headings not working as expected. #3747

korgan00 opened this issue Aug 31, 2023 · 9 comments

Comments

@korgan00
Copy link

korgan00 commented Aug 31, 2023

Package

@carbon/type

Browser

Chrome

Package version

11.23.0

React version

No response

Description

The fluid headings change size with the window size and not between breakpoints. Carbon Docs explicitly say that:

These headings are responsive and the type styles change size at different breakpoints.

Reproduction/example

https://carbon-elements.netlify.app/type/examples/preview/

Steps to reproduce

  • Install carbon/type.
  • Use this SCSS line in any heading. `@include type.type-style('fluid-heading-03', $fluid: true);
  • Change window size

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

IBM Quantum Learning

Code of Conduct

@tay1orjones
Copy link
Member

The fluid headings change size with the window size and not between breakpoints.

@korgan00 They do both, here's a screenshot from the elements preview you linked showing the output of the css:

image

fluid-heading-03 is the same value as $expressive-heading-03. The spec for this calls for changes at only two breakpoints, xlg and max:

https://github.com/carbon-design-system/carbon/blob/22c934941dfd858f42d989c5610963286ab672d9/packages/type/scss/_styles.scss#L342

https://github.com/carbon-design-system/carbon/blob/22c934941dfd858f42d989c5610963286ab672d9/packages/type/scss/_styles.scss#L322-L337

@korgan00
Copy link
Author

korgan00 commented Sep 1, 2023

@tay1orjones
Per documentation words I understood that the size should be fixed per breakpoint:

These headings are responsive and the type styles change size at different breakpoints.

And the implementation inside the demo uses a fixed size too. Is the documentation obsolete?

Captura de pantalla 2023-09-01 a las 16 51 05

@korgan00
Copy link
Author

@tay1orjones

@tay1orjones
Copy link
Member

tay1orjones commented Sep 15, 2023

@korgan00 The output through @carbon/react/@carbon/styles and the elements preview is correct. The carbondesignsystem.com docs simulate screen width and appear to be adding those inline styles that "chop" the definitions into values for each breakpoint.

My understanding is that it's intended for these to use the vw unit and respond to viewport width.

I'll move this issue over to the carbon-website repo since it's technically a bug on there that needs to be fixed. Thanks for pointing this out!

@korgan00
Copy link
Author

Thank you

@korgan00
Copy link
Author

korgan00 commented Oct 9, 2023

Any update here? Is there any issue in the carbon-website to follow up on?

@tw15egan
Copy link
Collaborator

The text needs to be updated to say something like

These headings are responsive and the type styles change based on the viewport width

@abdonrd
Copy link
Contributor

abdonrd commented Apr 29, 2024

Any update here? Thanks in advance!

@abdonrd
Copy link
Contributor

abdonrd commented Apr 29, 2024

I just create an small PR about it: #4043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⏱ Backlog
Development

No branches or pull requests

4 participants