Skip to content

Commit

Permalink
docs: use mdjs-layout
Browse files Browse the repository at this point in the history
  • Loading branch information
bashmish committed Jan 31, 2022
1 parent 8000422 commit 1e0acf2
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 59 deletions.
1 change: 0 additions & 1 deletion border-radius/doc/doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

# Border Radius
Expand Down
2 changes: 0 additions & 2 deletions button/doc/button.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
```js script
import 'https://gitcdn.link/repo/PrismJS/prism-themes/master/themes/prism-vsc-dark-plus.css';
import Button from '../src/Button.vue';
import '~/md-layout';
```

# Button
Expand Down
1 change: 0 additions & 1 deletion colors/doc/colors.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

# Colors
Expand Down
File renamed without changes
39 changes: 39 additions & 0 deletions doc-layout/src/template.js
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>
`;
1 change: 0 additions & 1 deletion elevation/doc/doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

# Elevation
Expand Down
6 changes: 0 additions & 6 deletions introduction/doc/index.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
```js script
import '~/md-layout';
```

<doc-logo></doc-logo>

# Vue.js v3.x Tech Sample

This is a simple Vue.js-based Design System sample.
Expand Down
1 change: 0 additions & 1 deletion md-layout/index.js

This file was deleted.

7 changes: 0 additions & 7 deletions md-layout/src/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions md-layout/src/logo.svg.js

This file was deleted.

13 changes: 0 additions & 13 deletions md-layout/src/md-layout.css

This file was deleted.

5 changes: 5 additions & 0 deletions mdjs.config.js
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,
};
1 change: 0 additions & 1 deletion spacing/doc/doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

# Spacing
Expand Down
2 changes: 1 addition & 1 deletion studio.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
]
],
["components", ["button"]],
["dockit", ["md-layout"]]
["infrastructure", ["doc-layout"]]
]
}
}
3 changes: 0 additions & 3 deletions theme/doc/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

<doc-logo></doc-logo>

# Vue Theme

This _theme_ for [Vue.js](https://vuejs.org/) is using tokens defined at the top level (i.e. `:where(html)`) to build its own internal tokens. It also defines specific variants (`light` and `dark`) at `html` level based on the top-level tokens.
Expand Down
1 change: 0 additions & 1 deletion transition/doc/doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

# Transition
Expand Down
1 change: 0 additions & 1 deletion typography/doc/typography.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

# Typography
Expand Down
1 change: 0 additions & 1 deletion z-index/doc/doc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```js script
import '@divriots/dockit-core/css-showcases';
import '~/md-layout';
```

# zIndices
Expand Down

0 comments on commit 1e0acf2

Please sign in to comment.