Skip to content

Commit

Permalink
fix(components/navigation-menu): fix item height #1964
Browse files Browse the repository at this point in the history
  • Loading branch information
ickisIckis committed Aug 23, 2024
1 parent 209c631 commit e980053
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
28 changes: 20 additions & 8 deletions apps/doc/src/app/components/tree/tree.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,23 @@
#treeControllerElement="prizmTreeController"
[prizmTreeController]="prizmTreeController"
>
<prizm-tree-item #element="prizmTreeItem">
<prizm-tree-item #element="prizmTreeItem" [style.--prizm-tree-item-height]="treeItemHeight">
Fruits
<prizm-tree-item>
<prizm-tree-item [style.--prizm-tree-item-height]="treeItemHeight">
Apples
<prizm-tree-item>Granny Smith</prizm-tree-item>
<prizm-tree-item>Red Delicious</prizm-tree-item>
<prizm-tree-item [style.--prizm-tree-item-height]="treeItemHeight"
>Granny Smith</prizm-tree-item
>
<prizm-tree-item [style.--prizm-tree-item-height]="treeItemHeight"
>Red Delicious</prizm-tree-item
>
</prizm-tree-item>
<prizm-tree-item>Oranges</prizm-tree-item>
<prizm-tree-item [style.--prizm-tree-item-height]="treeItemHeight">>Oranges</prizm-tree-item>
</prizm-tree-item>
<prizm-tree-item>
<prizm-tree-item [style.--prizm-tree-item-height]="treeItemHeight">
Animals
<prizm-tree-item>Cats</prizm-tree-item>
<prizm-tree-item>Dogs</prizm-tree-item>
<prizm-tree-item [style.--prizm-tree-item-height]="treeItemHeight">Cats</prizm-tree-item>
<prizm-tree-item [style.--prizm-tree-item-height]="treeItemHeight">Dogs</prizm-tree-item>
</prizm-tree-item>
</ng-container>
</div>
Expand All @@ -88,6 +92,14 @@
heading="PrizmTreeItemControllerDirective"
hostComponentKey="PrizmTreeItemControllerDirective"
>
<ng-template
[(documentationPropertyValue)]="treeItemHeight"
documentationPropertyName="prizm-tree-item-height"
documentationPropertyType="string"
documentationPropertyMode="css-var"
>
Tree Item Height (default 32px)
</ng-template>
<ng-template
[(documentationPropertyValue)]="prizmTreeController"
documentationPropertyName="prizmTreeController"
Expand Down
1 change: 1 addition & 0 deletions apps/doc/src/app/components/tree/tree.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class TreeComponent {
];

public treeController = true;
public treeItemHeight = '32px';

public readonly setupModule: RawLoaderContent = import('./examples/setup-module.md?raw');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.prizm-navigation-menu {
--prizm-navigation-menu__item-padding: 8px 16px;
--prizm-navigation-menu__item-height: 40px;
--prizm-tree-item-height: 40px;

display: grid;
grid-template-rows: min-content;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
display: flex;
align-items: center;
&:not(:empty) {
height: 32px;
height: var(--prizm-tree-item-height, 32px);
}

:host-context(prizm-tree-item._expandable):not(._expandable) {
Expand Down

0 comments on commit e980053

Please sign in to comment.