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

Make ToolbarItem optional / remove it entirely? #469

Open
adamkudrna opened this issue Jun 26, 2023 · 0 comments
Open

Make ToolbarItem optional / remove it entirely? #469

adamkudrna opened this issue Jun 26, 2023 · 0 comments
Labels
BC Breaking change
Milestone

Comments

@adamkudrna
Copy link
Member

adamkudrna commented Jun 26, 2023

Now when the gap property in flex layouts is widely supported by browsers, we can get rid of ToolbarItem in most cases.

It needs to be thoroughly tested though.

Basic Usage

Before:

<Toolbar>
  <ToolbarItem></ToolbarItem>
  <ToolbarItem></ToolbarItem>
</Toolbar>

After:

<Toolbar>
  …
  …
</Toolbar>

Groups

Groups are still necessary to, well, group items together.

Before:

<Toolbar>
  <ToolbarGroup>
    <ToolbarItem></ToolbarItem>
    <ToolbarItem></ToolbarItem>
  </ToolbarGroup>
</Toolbar>

After:

<Toolbar>
  <ToolbarGroup>
    …
    …
  </ToolbarGroup>
</Toolbar>

Flexible Items

We may still need ToolbarItem for flexible items:

Image

But! As @mbohal pointed out, Grid may be more suitable for this kind of layout. ToolbarItem then could be removed entirely.

Before:

<Toolbar>
  <ToolbarItem flexible></ToolbarItem>
  <ToolbarItem></ToolbarItem>
</Toolbar>

After:

<Grid columns="1fr auto">
  …
  …
</Grid>
@adamkudrna adamkudrna converted this from a draft issue Jun 26, 2023
@adamkudrna adamkudrna changed the title Simplify Toolbar using gap instead of negative margins Make ToolbarItem optional Jun 26, 2023
@adamkudrna adamkudrna changed the title Make ToolbarItem optional Make ToolbarItem optional / remove it entirely? Jun 28, 2023
@adamkudrna adamkudrna added BC Breaking change and removed refactoring labels Jun 28, 2023
@adamkudrna adamkudrna added this to the v1.0.0 milestone Sep 2, 2024
@adamkudrna adamkudrna moved this from 💡Ideas to 📋 Backlog in The Board Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC Breaking change
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant