-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: customization support for breadcrumb
- label with *xngBreadcrumbItem directive. - custom icon/ component for separator using ng-template - better API with single entry point method i.e set() - better styling and class names to support custom components - deprecated methods and properties with warning messages
- Loading branch information
1 parent
c8ee93a
commit b9aff64
Showing
9 changed files
with
271 additions
and
153 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Directive } from '@angular/core'; | ||
|
||
@Directive({ | ||
selector: '[xngBreadcrumbItem]' | ||
}) | ||
export class BreadcrumbItemDirective { | ||
constructor() {} | ||
} |
31 changes: 21 additions & 10 deletions
31
projects/xng-breadcrumb/src/lib/breadcrumb.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 27 additions & 34 deletions
61
projects/xng-breadcrumb/src/lib/breadcrumb.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,42 @@ | ||
.breadcrumb { | ||
display: -ms-flexbox; | ||
display: flex; | ||
-ms-flex-wrap: wrap; | ||
flex-wrap: wrap; | ||
.xng-breadcrumb-root { | ||
margin: 0; | ||
color: rgba(0, 0, 0, 0.6); | ||
} | ||
|
||
ol { | ||
.xng-breadcrumb-list { | ||
display: flex; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
} | ||
|
||
a { | ||
cursor: pointer; | ||
box-sizing: border-box; | ||
opacity: 0.75; | ||
white-space: nowrap; | ||
color: inherit; | ||
background: transparent; | ||
line-height: 36px; | ||
padding: 0 8px; | ||
outline: 0; | ||
text-decoration: none; | ||
.xng-breadcrumb-item { | ||
list-style: none; | ||
} | ||
|
||
a:hover, | ||
a:focus { | ||
text-decoration: unset; | ||
opacity: 1; | ||
.xng-breadcrumb-trail { | ||
display: flex; | ||
align-items: center; | ||
color: rgba(0, 0, 0, 0.9); | ||
} | ||
|
||
.current-path { | ||
box-sizing: border-box; | ||
.xng-breadcrumb-link { | ||
display: flex; | ||
align-items: center; | ||
white-space: nowrap; | ||
color: inherit; | ||
background: transparent; | ||
line-height: 36px; | ||
padding: 0 8px; | ||
opacity: 0.75; | ||
text-decoration: none; | ||
transition: text-decoration 0.3s; | ||
} | ||
|
||
.xng-breadcrumb-link:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.separator { | ||
display: inline-block; | ||
opacity: 0.5; | ||
font-weight: normal; | ||
font-style: normal; | ||
font-size: 1.1em; | ||
.xng-breadcrumb-separator { | ||
display: flex; | ||
user-select: none; | ||
margin-left: 8px; | ||
margin-right: 8px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { BreadcrumbItemDirective } from './breadcrumb-item.directive'; | ||
import { BreadcrumbComponent } from './breadcrumb.component'; | ||
|
||
@NgModule({ | ||
declarations: [BreadcrumbComponent], | ||
declarations: [BreadcrumbComponent, BreadcrumbItemDirective], | ||
imports: [CommonModule, RouterModule], | ||
exports: [BreadcrumbComponent] | ||
exports: [BreadcrumbComponent, BreadcrumbItemDirective] | ||
}) | ||
export class BreadcrumbModule {} |
Oops, something went wrong.