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

WIP: Header & Navigation Preview #1784

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/demo/partials/web/layout/default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
{{> cover}}

<main class="py-1000">
<div class="Container">

{{#unless isFullWidth}}
<div class="Container">
{{/unless}}

{{> @partial-block}}

</div>
{{#unless isFullWidth}}
</div>
{{/unless}}

</main>

{{> footer}}
Expand Down
7 changes: 7 additions & 0 deletions packages/web/src/scss/components/Navigation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Divider

The `Divider` component is used as horizontal separator of the content.

```html
<hr class="Divider" />
```
35 changes: 35 additions & 0 deletions packages/web/src/scss/components/Navigation/_Navigation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@use '../../tools/reset';
@use 'theme';

.Navigation,
.Navigation > ul,
.Navigation > ul > li {
display: flex;
}

.Navigation:not(.Navigation--main),
.Navigation:not(.Navigation--main) > ul {
gap: theme.$gap;
align-content: center;
}

.Navigation > ul {
@include reset.list();
}

.Navigation--main {
align-self: stretch;
align-items: stretch;
}

.Navigation--start {
margin-inline-end: auto;

&:not(:first-child) {
margin-inline-start: theme.$start-spacing;
}
}

.Navigation--end {
margin-inline-start: auto;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
@use '../../tools/typography';
@use 'theme';

.NavigationLink {
@include typography.generate(theme.$link-typography);

display: flex;
align-items: center;
justify-content: center;
padding-inline: theme.$link-spacing;
color: theme.$link-color-state-default;
border-top: theme.$link-border-bottom-width theme.$link-border-bottom-style transparent;
border-bottom: theme.$link-border-bottom-width theme.$link-border-bottom-style
theme.$link-border-bottom-color-style-state-default;
background-color: theme.$link-background-color-state-default;

@media (hover: hover) {
&:hover {
text-decoration: none;
color: theme.$link-color-state-hover;
background-color: theme.$link-background-color-state-hover;
}
}

&:active {
color: theme.$link-color-state-active;
background-color: theme.$link-background-color-state-active;
}
}

.NavigationLink--selected {
color: theme.$link-color-state-selected;
border-bottom-color: theme.$link-border-bottom-color-style-selected-state-default;
background-color: theme.$link-background-color-state-selected;

@media (hover: hover) {
&:hover {
border-bottom-color: theme.$link-border-bottom-color-style-selected-state-hover;
}
}

&:active {
border-bottom-color: theme.$link-border-bottom-color-style-selected-state-active;
}
}

.NavigationLink--disabled {
color: theme.$link-color-state-disabled;
pointer-events: none;
}
22 changes: 22 additions & 0 deletions packages/web/src/scss/components/Navigation/_theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@use '@tokens' as tokens;

$gap: tokens.$space-700;
$start-spacing: tokens.$space-1000;

$link-typography: tokens.$body-small-semibold;
$link-spacing: tokens.$space-600;
$link-color-state-default: tokens.$component-header-item-state-default;
$link-color-state-hover: tokens.$component-header-item-state-hover;
$link-color-state-active: tokens.$component-header-item-state-active;
$link-color-state-selected: tokens.$component-header-item-state-selected;
$link-color-state-disabled: tokens.$disabled-content;
$link-border-bottom-width: tokens.$border-width-200;
$link-border-bottom-style: solid;
$link-border-bottom-color-style-state-default: transparent;
$link-border-bottom-color-style-selected-state-default: tokens.$component-header-stripe-state-selected;
$link-border-bottom-color-style-selected-state-hover: tokens.$component-header-stripe-state-unselected;
$link-border-bottom-color-style-selected-state-active: tokens.$component-header-stripe-state-unselected;
$link-background-color-state-default: tokens.$component-header-item-background-state-default;
$link-background-color-state-hover: tokens.$component-header-item-background-state-hover;
$link-background-color-state-active: tokens.$component-header-item-background-state-active;
$link-background-color-state-selected: tokens.$component-header-item-background-state-selected;
10 changes: 10 additions & 0 deletions packages/web/src/scss/components/Navigation/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{#> web/layout/default title="Navigation" parentPageName="Components" }}

<section class="UNSTABLE_Section">
<h2 class="docs-Heading">Default</h2>
<div class="docs-Stack docs-Stack--stretch">
x
</div>
</section>

{{/web/layout/default }}
2 changes: 2 additions & 0 deletions packages/web/src/scss/components/Navigation/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@forward 'Navigation';
@forward 'NavigationLink';
Loading
Loading