shopware / meteor

Meteor is Shopware’s open-source design system that drives our commerce solutions. Extend and customise every aspect of Shopware – create elegant, delightful, and accessible experiences. There are no limits to your imagination.
https://shopware.design
MIT License
19 stars 4 forks source link

Add future flag for no default margin #298

Closed Haberkamp closed 1 month ago

Haberkamp commented 1 month ago

What?

This PR adds a future flag for adding the default margin.

Why?

Components should work in isolation. Adding a default margin to every component breaks that concept. Having a default margin ties the component to a specific context that it should work in. Once the component is used outside of that context you have to work around it. Make modifications to that component i.e. remove the default margin from the component.

That new behavior is how every other component library out there does it. There's no default bottom margin for that component. If you want to add some space between the components you have to do that through the parent component or add a custom class on top of that component to add some spacing.

How?

I've added a new future flag. By default it is disabled. But if you want you can enable it. This will remove the default bottom margin for the components.

Testing?

You can test it yourself by adding a theme provider at the top of the application and setting the removeDefaultMargin to true

Screenshots (optional)

Anything Else?

Right now this only works for the mt-tabs component.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
meteor-component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 1:33pm
1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **meteor-admin-sdk-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/shopware-frontends/meteor-admin-sdk-docs/6C9fx5SdEJjWW6MmtDpmNRuTp9TL)) | [Visit Preview](https://meteor-admin-sdk-docs-git-add-future-8de91e-shopware-frontends.vercel.app) | | Sep 18, 2024 1:33pm |
pkg-pr-new[bot] commented 1 month ago

Open in Stackblitz

pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-icon-kit@298
pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-admin-sdk@298
pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-tokens@298
pnpm add https://pkg.pr.new/shopware/meteor/@shopware-ag/meteor-component-library@298

commit: 519f7cb