seek-oss / playroom

Design with JSX, powered by your own component library.
MIT License
4.45k stars 183 forks source link

:sparkles: add new config variable "defaultWidths" #302

Closed JulianNymark closed 4 months ago

JulianNymark commented 7 months ago

What and Why?

Allow default widths to be set to something other than "show all the widths available", since we support a lot of breakpoints, but for the average developer using our design system it's a bit overwhelming to see all of them + horizontal scroll when they are usually just interested in one or two breakpoints (for us it's usually a mobile width + generic desktop widths).

image

How?

introduces a configuration variable defaultWidths that becomes the viewports rendered when you have no width check mark selected in the sidebar (as shown in the screenshot above).

module.exports = {
  // ...
  widths: [320, 480, 768, 1024, 1280, 1440],
  defaultWidths: [320, 1280]
};
changeset-bot[bot] commented 7 months ago

⚠️ No Changeset found

Latest commit: e6c806a0cca6a32781ee347deadd3bb845acaf84

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

michaeltaranto commented 4 months ago

Addressed by https://github.com/seek-oss/playroom/pull/305