-
Notifications
You must be signed in to change notification settings - Fork 0
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
Use mdjs-layout #4
Changes from all commits
804d0ad
54a19ba
0612506
c6deacd
a0a46f8
70ee772
79ce950
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
```js script | ||
import '@divriots/dockit-core/sass-showcases'; | ||
import { html } from '~/md-layout'; | ||
import '@divriots/dockit-core/css-showcases'; | ||
``` | ||
|
||
# Border Radius | ||
|
||
## border-radius | ||
|
||
```html:html | ||
<dockit-sass-showcases | ||
```html story | ||
<dockit-css-showcases | ||
css-props-prefix="--border-radius" | ||
component-class="box" | ||
style-key="border-radius" | ||
checkered-background="false" | ||
></dockit-sass-showcases> | ||
></dockit-css-showcases> | ||
``` |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
```js script | ||
import '@divriots/dockit-core/sass-showcases'; | ||
import { html } from '~/md-layout'; | ||
import '@divriots/dockit-core/css-showcases'; | ||
``` | ||
|
||
# Colors | ||
|
||
## background-color | ||
|
||
```html:html | ||
<dockit-sass-showcases | ||
```html story | ||
<dockit-css-showcases | ||
css-props-prefix="--color" | ||
component-class="box" | ||
style-key="background-color" | ||
></dockit-sass-showcases> | ||
></dockit-css-showcases> | ||
``` | ||
|
||
## color | ||
|
||
```html:html | ||
<dockit-sass-showcases | ||
```html story | ||
<dockit-css-showcases | ||
css-props-prefix="--color" | ||
component-type="text" | ||
style-key="color" | ||
></dockit-sass-showcases> | ||
></dockit-css-showcases> | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import '@divriots/dockit-core/style.css'; | ||
import '@divriots/dockit-core/mdjs-layout/define.js'; | ||
import { styles } from '@divriots/dockit-core/mdjs-layout'; | ||
import { html } from 'lit'; | ||
import { unsafeHTML } from 'lit/directives/unsafe-html.js'; | ||
import logoSvg from './logo.svg?raw'; | ||
import '~/theme/src/theme.scss'; | ||
|
||
export const docLayoutTemplate = (content, context) => html` | ||
<style> | ||
${unsafeHTML(styles)} .preview-story .story_padded { | ||
background-color: var(--doc-color-background); | ||
} | ||
.box { | ||
width: 4rem; | ||
height: 4rem; | ||
background-color: var(--color-white); | ||
box-shadow: var(--shadow-large); | ||
border-radius: var(--border-radius-medium); | ||
} | ||
</style> | ||
<mdjs-layout | ||
.context="${context}" | ||
@color-scheme-change="${(event) => { | ||
if (event.detail.colorScheme === 'dark') { | ||
document.documentElement.classList.add('dark'); | ||
document.documentElement.setAttribute('color-scheme', 'dark'); | ||
} else { | ||
document.documentElement.classList.remove('dark'); | ||
document.documentElement.setAttribute('color-scheme', 'light'); | ||
} | ||
}}" | ||
> | ||
<div class="logo" slot="logo" aria-label="starter-vue3"> | ||
${unsafeHTML(logoSvg)} | ||
</div> | ||
<div class="prose dark:prose-invert">${unsafeHTML(content)}</div> | ||
</mdjs-layout> | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
```js script | ||
import '@divriots/dockit-core/sass-showcases'; | ||
import { html } from '~/md-layout'; | ||
import '@divriots/dockit-core/css-showcases'; | ||
``` | ||
|
||
# Elevation | ||
|
||
## box-shadow | ||
|
||
```html:html | ||
<dockit-sass-showcases | ||
```html story | ||
<dockit-css-showcases | ||
css-props-prefix="--shadow" | ||
component-class="box" | ||
style-key="box-shadow" | ||
checkered-background="false" | ||
></dockit-sass-showcases> | ||
></dockit-css-showcases> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. elevation is not visible in the dark mode one might think it's because of if you feel like it's because of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, I agree on having two different set of shadows for light/dark modes. Thanks 👍 |
||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
```js script | ||
import { html } from '~/md-layout'; | ||
``` | ||
|
||
<vue-logo></vue-logo> | ||
<nuxt-logo></nuxt-logo> | ||
|
||
# Vue.js v3.x Tech Sample | ||
|
||
This is a simple Vue.js-based Design System sample. | ||
|
@@ -46,32 +39,32 @@ Get the command to link your Design System in your local project. To so, click t | |
Your browser will open the URL given by the command. You'll see the default NuxtJS starting page. | ||
3. Open your project in your IDE, and go to the file `~/app.vue` | ||
4. Add a `<script>` tag, add the following lines to import the Design System `Button` component | ||
```vue | ||
```html | ||
<script setup lang="ts"> | ||
import Button from '@backlight-dev/john.design-system/button/src/Button.vue'; | ||
import MyButton from '@backlight-dev/john.design-system/button/src/Button.vue'; | ||
</script> | ||
``` | ||
5. Add a `<style>` tag to import the Design System Sass primitives at `app` level | ||
```vue | ||
```html | ||
<style lang="scss"> | ||
@use '@backlight-dev/john.design-system/theme/src/theme.scss'; | ||
@use '@backlight-dev/john.design-system/theme/src/theme.scss'; | ||
</style> | ||
``` | ||
6. Finally, replace the `app.vue`'s `<template>` tag content with a `Button` component instance. Your final `app.vue` file will look like: | ||
|
||
```vue | ||
```html | ||
<template> | ||
<div> | ||
<Button outlined name="Rioters 🤘" /> | ||
<MyButton outlined name="Rioters 🤘" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to change |
||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import Button from '@backlight-dev/john.design-system/button/src/Button.vue'; | ||
import MyButton from '@backlight-dev/john.design-system/button/src/Button.vue'; | ||
</script> | ||
|
||
<style lang="scss"> | ||
@use '@backlight-dev/john.design-system/theme/src/theme.scss'; | ||
@use '@backlight-dev/john.design-system/theme/src/theme.scss'; | ||
</style> | ||
``` | ||
|
||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { docLayoutTemplate } from './doc-layout/src/template'; | ||
|
||
export default { | ||
layout: docLayoutTemplate, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
```js script | ||
import '@divriots/dockit-core/sass-showcases'; | ||
import { html } from '~/md-layout'; | ||
import '@divriots/dockit-core/css-showcases'; | ||
``` | ||
|
||
# Spacing | ||
|
||
## spaces | ||
|
||
```html:html | ||
<dockit-sass-showcases css-props-prefix="--spacing"></dockit-sass-showcases> | ||
```html story | ||
<dockit-css-showcases css-props-prefix="--spacing"></dockit-css-showcases> | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since I fixed
dockit-css-showcases
to properly show opacity in the documentation context, it became clear that one of the colors you have is transparent... not sure if you meant that or created such color by mistake, please double check