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

story: provide lean context config #3010

Closed
jeripeierSBB opened this issue Aug 21, 2024 · 4 comments · Fixed by #3233
Closed

story: provide lean context config #3010

jeripeierSBB opened this issue Aug 21, 2024 · 4 comments · Fixed by #3233
Assignees
Milestone

Comments

@jeripeierSBB
Copy link
Contributor

jeripeierSBB commented Aug 21, 2024

We want to provide defaults for the lean context.
We will do this programmatically by creating a function isLean, which checks whether the <html> element has the sbb-lean css class.
The default value for the relevant properties is set that way: public accessor size: 's' | 'm' | 'l' = isLean() ? 's' : 'm';

@jeripeierSBB jeripeierSBB converted this from a draft issue Aug 21, 2024
@jeripeierSBB jeripeierSBB added this to the Release 2.0.0 milestone Aug 21, 2024
@kyubisation kyubisation moved this from To do to Next in ESTA Web Lyne Design System Oct 30, 2024
@DavideMininni-Fincons DavideMininni-Fincons self-assigned this Nov 20, 2024
@DavideMininni-Fincons
Copy link
Contributor

@kyubisation @jeripeierSBB
I created the basic function and, as mentioned in the daily, I modified every component with the size property to set the default size equal to the smallest available size if isLean returns true.

Now I'm wondering: do i have to implement a controller too? like the SbbLanguageController? because now the size doesn't change if the class on the body dynamically changes.

@kyubisation
Copy link
Contributor

I would say no for now, even if it is an inconvenience. My goal would be to define the default via CSS and not via js, but that would probably be part of the css refactoring.

@DavideMininni-Fincons
Copy link
Contributor

Ok, then I can open a draft pr 👍

another question: do we need some kind of testing/visual testing/something for Manuel?
eg. on Storybook the default is usually overridden, so i have tested the behavior only via console;
should I created a home-lean demo page? or specific stories for each component that I changed?

@kyubisation
Copy link
Contributor

Hm, maybe as you suggested a home-lean demo page? I think that should be enough for now.

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

Successfully merging a pull request may close this issue.

3 participants