-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(description): expand it with crafted sw items (#9)
* feat(description): expand description with items crafted * fix(description): add link URL to SSO * feat(description): add security in mind * feat(description): add HTTP REST APIs * feat(description): static collapsible list * perf: inline .sr-only to avoid layout flash / shift * feat(description): add collapsible animations * feat(description): light theme link colors * feat(description): do not collapse non-collapsible lists * feat(description): expanded when no JS * refactor: explicit noscript visibility/display utils * feat(description): move title into profile * feat: switch to Helvetica as it's more universal
- Loading branch information
Showing
26 changed files
with
805 additions
and
170 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@use "sass:color"; | ||
@use "sass:map"; | ||
|
||
@mixin color($theme) { | ||
$text-palette: map.get($theme, text); | ||
$primary: map.get($text-palette, primary); | ||
|
||
app-description { | ||
a { | ||
text-decoration-color: color.adjust($primary, $alpha: -0.75); | ||
} | ||
} | ||
} |
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,7 +1,23 @@ | ||
<h2 *ngFor="let descriptionLine of descriptionLines"> | ||
<span aria-hidden="true"> | ||
<span class="material-symbols-outlined">{{ descriptionLine.symbol }}</span> | ||
<span [innerHTML]="descriptionLine.text"></span> | ||
</span> | ||
<span class="sr-only" [innerHtml]="descriptionLine.text"></span> | ||
</h2> | ||
<ng-container *ngIf="!isCollapsible; else collapsibleTemplate"> | ||
<div class="data" *ngIf="line.data"> | ||
<ng-container [ngTemplateOutlet]="dataTemplate"></ng-container> | ||
</div> | ||
</ng-container> | ||
<ng-template #collapsibleTemplate> | ||
<button class="data" type="button" [attr.aria-expanded]="isExpanded" [attr.aria-controls]="sluggedId" | ||
(click)="isExpanded ? this.collapse() : this.expand()" | ||
> | ||
<span class="caret displayNoneIfNoScript" aria-hidden="true">{{ isExpanded ? config.expandedIcon : config.collapsedIcon }}</span> | ||
<ng-container [ngTemplateOutlet]="dataTemplate"></ng-container> | ||
</button> | ||
</ng-template> | ||
<ng-template #dataTemplate> | ||
<span class="symbol material-symbols-outlined" aria-hidden="true" *ngIf="line.data">{{ line.data.symbol }}</span> | ||
<span class="content" [innerHtml]="sanitizer.bypassSecurityTrustHtml(line.data?.html ?? '')"></span> | ||
</ng-template> | ||
<ul *ngIf="line.children.length" [attr.id]="sluggedId" [@expanded]="isCollapsible ? isExpanded : true"> | ||
<li *ngFor="let line of line.children"> | ||
<app-description [line]="line" [depth]="depth+1"> | ||
</app-description> | ||
</li> | ||
</ul> |
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,21 +1,74 @@ | ||
@use "margins"; | ||
@use "paddings"; | ||
|
||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
gap: margins.$s; | ||
&.hidden { | ||
visibility: hidden; | ||
} | ||
|
||
h2 > span { | ||
font-size: 1.1rem; | ||
text-align: left; | ||
width: fit-content; | ||
ul { | ||
display: flex; | ||
flex-direction: column; | ||
gap: margins.$m; | ||
} | ||
|
||
// Indentation for nested lists | ||
ul ul { | ||
margin-left: margins.$l; | ||
} | ||
|
||
ul ul > li:first-child { | ||
margin-top: margins.$m; | ||
} | ||
|
||
.data { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
word-break: break-word; | ||
font-size: 1.5rem; | ||
gap: margins.$s; | ||
text-align: left; | ||
|
||
> span { | ||
font-size: 1em; | ||
// If we move it outside this selector, conflicts with root <a> styles | ||
::ng-deep a { | ||
text-decoration-line: underline; | ||
text-decoration-thickness: 1px; | ||
} | ||
} | ||
|
||
.material-symbols-outlined { | ||
font-size: 1em; | ||
font-variation-settings: 'FILL' 1, | ||
'wght' 700, | ||
'GRAD' 200, | ||
'opsz' 24 | ||
} | ||
|
||
button { | ||
cursor: pointer; | ||
background-color: transparent; | ||
border: none; | ||
color: inherit; | ||
font-family: inherit; | ||
} | ||
|
||
.caret { | ||
font-size: .5em; | ||
width: .75em; | ||
} | ||
|
||
// Content-specific customizations | ||
::ng-deep a.craft { | ||
text-decoration-line: underline; | ||
text-decoration-color: currentColor; | ||
} | ||
|
||
.data[aria-expanded="false"] + ul { | ||
overflow: hidden; | ||
} | ||
|
||
.data[aria-expanded] + ul .data { | ||
font-size: 1.25rem; | ||
} | ||
} |
Oops, something went wrong.