-
Notifications
You must be signed in to change notification settings - Fork 14
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 #213 from Tap30/feat/add-design-guidline-template
docs: add design layout
- Loading branch information
Showing
40 changed files
with
732 additions
and
203 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
// .vitepress/theme/index.js | ||
import DefaultTheme from 'vitepress/theme' | ||
import './custom.css' | ||
import '../../components' | ||
import '../../../styles/theme.css' | ||
|
||
export default DefaultTheme | ||
export default { | ||
extends: DefaultTheme, | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
docs/components/doc-guideline-card/doc-guideline-card.style.ts
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,73 @@ | ||
import {css} from "lit"; | ||
|
||
export default css` | ||
:host { | ||
box-sizing: border-box; | ||
flex: 1; | ||
align-self: stretch; | ||
display: flex; | ||
} | ||
:host *, | ||
:host *::before, | ||
:host *::after { | ||
box-sizing: inherit; | ||
} | ||
.guideline-card { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: 1rem; | ||
border-radius: 8px; | ||
padding: 16px 16px 8px; | ||
line-height: 24px; | ||
font-size: var(--vp-custom-block-font-size); | ||
border-color: var(--vp-custom-block-info-border); | ||
color: var(--vp-custom-block-info-text); | ||
background-color: var(--vp-custom-block-info-bg); | ||
} | ||
.image { | ||
margin: auto; | ||
} | ||
.image img { | ||
width: 100%; | ||
} | ||
.badge { | ||
display: inline-block; | ||
margin-left: 2px; | ||
border: 1px solid transparent; | ||
height: 26px; | ||
border-radius: 12px; | ||
padding: 0 10px; | ||
font-size: 12px; | ||
font-weight: 500; | ||
transform: translateY(10px); | ||
} | ||
.do { | ||
background-color: var(--tap-palette-green-400); | ||
color: #ffffff; | ||
} | ||
.dont { | ||
background-color: var(--tap-palette-red-400); | ||
color: #ffffff; | ||
} | ||
.caution { | ||
background-color: var(--tap-palette-yellow-400); | ||
color: #000000; | ||
} | ||
@media (max-width: 1100px) { | ||
:host { | ||
width: 100%; | ||
align-items: stretch; | ||
} | ||
.guideline-card { | ||
width: 100%; | ||
} | ||
} | ||
`; |
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,48 @@ | ||
import {html, LitElement, nothing} from 'lit'; | ||
import {property} from 'lit/decorators.js'; | ||
|
||
export class GuidelineCard extends LitElement { | ||
@property({ attribute: 'image-url' }) imageUrl = ''; | ||
|
||
@property() variant?: 'do' | 'dont' | 'caution'; | ||
|
||
private renderBadge () { | ||
|
||
const badgeConfig = { | ||
do: { | ||
title: 'Do', | ||
class: 'do' | ||
}, | ||
dont: { | ||
title: 'Don\'t', | ||
class: 'dont' | ||
}, | ||
caution: { | ||
title: 'Caution', | ||
class: 'caution' | ||
}, | ||
} | ||
|
||
|
||
if (this.variant && Object.keys(badgeConfig).includes(this.variant)) { | ||
const selectedBadge = badgeConfig[this.variant]; | ||
return html`<div class="badge ${selectedBadge.class}">${selectedBadge.title}</div>` | ||
} | ||
return nothing | ||
} | ||
|
||
render() { | ||
return html` | ||
<div part="guideline-card" class="guideline-card "> | ||
<div class="image"> | ||
<slot name="card-image"></slot> | ||
</div> | ||
${this.renderBadge()} | ||
<div class="content"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
`; | ||
} | ||
} | ||
|
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,14 @@ | ||
import { customElement } from 'lit/decorators.js'; | ||
import styles from './doc-guideline-card.style'; | ||
import {GuidelineCard} from "./doc-guideline-card"; | ||
|
||
@customElement('doc-guideline-card') | ||
export class DocGuidelineCard extends GuidelineCard { | ||
static readonly styles = [styles]; | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'doc-guideline-card': DocGuidelineCard; | ||
} | ||
} |
Oops, something went wrong.