-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from hotosm/feature/styles
Styles code improvements, Header component, + Logo component
- Loading branch information
Showing
15 changed files
with
222 additions
and
336 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,6 @@ site | |
**/**/*.js | ||
**/**/*.js.map | ||
**/**/*.d.ts | ||
|
||
# Common system files | ||
.DS_Store |
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,19 @@ | ||
// The HOT logo | ||
|
||
import type { Meta, StoryObj } from "@storybook/web-components"; | ||
import "../../components/index"; | ||
import { html } from "lit"; | ||
|
||
const meta: Meta = { | ||
title: "Logo", | ||
component: "hot-logo", | ||
}; | ||
export default meta; | ||
|
||
export const Template: StoryObj = { | ||
render: (args, { parameters }) => { | ||
return html` | ||
<hot-logo></hot-logo> | ||
`; | ||
}, | ||
}; |
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,40 @@ | ||
import { cva } from "class-variance-authority"; | ||
import { css } from "lit"; | ||
|
||
export const headerVariants = cva( | ||
// Defaults to include in all variants | ||
` | ||
hot-flex hot-flex-row hot-bg-[var(--sl-color-white)] hot-items-center hot-justify-between | ||
hot-sm:justify-around hot-p-2 hot-border-b-2 hot-border-b-gray-100 hot-border-b-solid | ||
`, | ||
{ | ||
variants: { | ||
size: { | ||
small: "hot-h-8", | ||
large: "hot-h-14", | ||
}, | ||
}, | ||
} | ||
); | ||
|
||
export type sizes = "small" | "large"; | ||
|
||
export const styles = [ | ||
css` | ||
@unocss-placeholder; | ||
`, | ||
css` | ||
.logo-link { | ||
text-decoration: none; | ||
} | ||
sl-tab-group { | ||
display: flex; | ||
} | ||
sl-tab::part(base) { | ||
font-size: var(--sl-font-size-2); | ||
} | ||
`, | ||
]; |
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,31 @@ | ||
import "../../theme/hot.css"; | ||
|
||
import { LitElement, html } from "lit"; | ||
import { property } from "lit/decorators.js"; | ||
|
||
export class Logo extends LitElement { | ||
|
||
@property() name = "hot-logo"; | ||
|
||
/** Display the icon only */ | ||
@property({ type: Boolean }) iconOnly: boolean = false; | ||
|
||
/** Display the text only */ | ||
@property({ type: Boolean }) textOnly: boolean = false; | ||
|
||
protected render() { | ||
|
||
return html` | ||
<h1 class="hot-flex hot-flex-row"> | ||
${ !this.textOnly ? html`<img src="../../theme/logo/hot-logo-icon.svg" />` : null } | ||
${ !this.iconOnly ? html`<img src="../../theme/logo/hot-logo-text.svg" />` : null } | ||
</h1> | ||
`; | ||
} | ||
|
||
} | ||
|
||
export default Logo; | ||
|
||
// Define web component | ||
customElements.define("hot-logo", Logo); |
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
Oops, something went wrong.