Skip to content

toolbar: unable to specify attributes on first toolbar-row #1718

@ThomasBurleson

Description

@ThomasBurleson

Bug, feature request, or proposal:

md-toolbar projects content to an internal md-toolbar-row container and uses FlexBox css to layout in 'row' directions for that container. This means that custom CSS must be used to modify the direction to 'column'.

To achieve something like this is a challenge:

toolbar-flow-directions

And using the pending Layout API does not work:

<md-toolbar fx-layout="column">
    <div fx-layout="row" fx-layout-align="start center">  Title and buttons here </div>
    <div fx-flex="15px">        simulate a gap                                    </div>
    <div fx-layout="column">    2 lines of text organized vertically              </div>
</md-toolbar>

By default this will layout each child div in a single row instead of the requested column flow direction.

An option for the developer is to use custom CSS:

md-toolbar .md-toolbar-layout md-toolbar-row {
  flex-direction: column;
  align-content: flex-start;
  align-items: flex-start;
  min-height: 120px;
}

But this ^^ option is not intuitive and seems to violate the entire idea of the Layout API.

Another solution - of course - is that the developer can add a protection wrapper:

<md-toolbar>
   <div fx-layout="column">
      <div fx-layout="row" fx-layout-align="start center">  Title and buttons here </div>
      <div fx-flex="15px">        simulate a gap                                    </div>
      <div fx-layout="column">    2 lines of text organized vertically              </div>
   <div>
</md-toolbar>

but ^^ solution is dirty and adds complexity.

What are the steps to reproduce?

What is the use-case or motivation for changing an existing behavior?

I propose that all Layout APIs be transcluded to the md-toolbar-row element. This way the developer's original intent is preserved without additional workarounds or hacks.

Metadata

Metadata

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions