-
Notifications
You must be signed in to change notification settings - Fork 390
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
FluentCard work #895
FluentCard work #895
Conversation
vnbaaij
commented
Oct 26, 2023
- FluentCard: Add Width/Height. Update docs/samples
- FluentFooter: remove width from style
- Update WhatsNew
Footer: remove width from css Update WhatsNew
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-895.westeurope.3.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-pebble-0dc79cb03-895.westeurope.3.azurestaticapps.net |
This change should probably be considered a breaking change. It adds CSS code at a very high specificity, which overrides classes added to the card. https://github.com/microsoft/fluentui-blazor/blob/dev/src/Core/Components/Card/FluentCard.razor.css This CSS resolves to: fluent-card[b-6epdlk0xtt] {
padding: calc(var(--design-unit) * 5px);
} Which is a much higher specificity than the classes added via the component's @* This still has prominent padding. *@
<FluentCard Class="p-0">Hello World</FluentCard>
@* Only with the !important override does the padding get removed. *@
<FluentCard Class="!p-0">Hello World</FluentCard> If placed within global scope, rather than in a CSS module, these styles would be overridable naturally within the cascade. |
We want/need a Card to look good without the developer doing anything to achieve that. We add this padding on purpose to adhere to the Fluent Design system. |
I would agree with you, if this style was set at a global level. With a global style, every With CSS modules, each This means developers cannot create their own standard, overridable baselines for components, and it reduces their re-usability as Blazor components. It also breaks existing sites, and is not documented as doing so. FluentCards are used ubiquitously, for many purposes. They are probably one of the most commonly used components within FluenUI. A drastic, breaking change such as this should be, at the very least, documented as such. For what it's worth, I agree that a default padding is required for the cards. I just disagree with the specificity of the style. |