Skip to content

Commit

Permalink
feat(doc-layout): migrate to new mdjs-layout from @divriots/dockit-core
Browse files Browse the repository at this point in the history
  • Loading branch information
bashmish committed Dec 9, 2021
1 parent 007f7d0 commit ef53f27
Show file tree
Hide file tree
Showing 39 changed files with 3,099 additions and 2,128 deletions.
1 change: 0 additions & 1 deletion borders/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
```js script
import { html } from '~/core';
import '~/token-display';
import '~/doc-styles';
import { borderRadiusMixin as _borderRadiusMixin } from '../src/radius.css.js';
```

Expand Down
1 change: 0 additions & 1 deletion button/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Button web component.

```js script
import { html } from '~/core'
import '~/doc-styles';
import '../simba-button.js';
```

Expand Down
1 change: 0 additions & 1 deletion checkbox-group/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Checkbox group Webcomponent.
import { html } from '~/core';
import { localize } from '~/localize';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import '~/doc-styles';
import '../simba-checkbox.js';
import '../simba-checkbox-indeterminate.js';
import '../simba-checkbox-group.js';
Expand Down
1 change: 0 additions & 1 deletion collapsible/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Collapsible component, folds out content.

```js script
import { html } from '~/core';
import '~/doc-styles';
import '../simba-collapsible.js';
import '../simba-collapsible-button.js';
import '~/button/simba-button.js';
Expand Down
1 change: 0 additions & 1 deletion colors/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
```js script
import { html } from '~/core'
import '~/token-display';
import '~/doc-styles';
import {
coolGray as coolGrayTokens,
red as redTokens,
Expand Down
1 change: 0 additions & 1 deletion dialog/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The frame acts as a visual container and allows adding an easy to use close butt
```js script
import { html } from '~/core';
import '~/button/simba-button.js';
import '~/doc-styles';
import '../simba-dialog.js';
import '../simba-dialog-frame.js';
import { emerald, coolGray } from '~/colors';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ export class ColorToggler extends LitElement {
css`
:host {
display: flex;
max-width: 125px;
max-width: calc(1.25rem * 4 + 4px * 2 * 4);
flex-wrap: wrap;
margin: 0 10px;
}
.radio {
Expand Down Expand Up @@ -96,3 +95,5 @@ export class ColorToggler extends LitElement {
setTheme(newColor);
}
}

customElements.define('color-toggler', ColorToggler);
217 changes: 217 additions & 0 deletions doc-layout/src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions doc-layout/src/template.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import '@divriots/dockit-core/mdjs-layout/define';
import { breakpoints, styles } from '@divriots/dockit-core/mdjs-layout';
import { html, unsafeHTML } from '~/core';
import './color-toggler';
import logoSvg from './logo.svg?raw';

export const docLayoutTemplate = (content, context) => html`
<style>
${unsafeHTML(styles)} .logo {
color: #f59e0b;
}
.topbar {
width: 100%;
display: flex;
align-items: center;
justify-content: right;
}
@media screen and (min-width: ${breakpoints.lg}) {
.topbar {
justify-content: unset;
}
}
.preview-story .story_padded {
background-color: var(--simba-bg-color);
color: var(--simba-text-color);
}
html.dark .preview-story .story_padded {
background-color: var(--simba-bg-color-dark);
color: var(--simba-text-color-dark);
}
</style>
<mdjs-layout
.context="${context}"
@color-scheme-change="${(event) => {
if (event.detail.colorScheme === 'dark') {
document.documentElement.classList.add('dark');
document.documentElement.setAttribute('theme', 'dark');
} else {
document.documentElement.classList.remove('dark');
document.documentElement.setAttribute('theme', 'light');
}
}}"
>
<div class="logo" slot="logo" aria-label="starter-simba">
${unsafeHTML(logoSvg)}
</div>
<div class="topbar" slot="topbar">
Themes:&nbsp;
<color-toggler></color-toggler>
</div>
<div class="prose dark:prose-dark">${unsafeHTML(content)}</div>
</mdjs-layout>
`;
3 changes: 0 additions & 3 deletions doc-styles/color-toggler.js

This file was deleted.

3 changes: 0 additions & 3 deletions doc-styles/docs-menu.js

This file was deleted.

1 change: 0 additions & 1 deletion doc-styles/index.js

This file was deleted.

38 changes: 0 additions & 38 deletions doc-styles/src/DocsMenu.js

This file was deleted.

15 changes: 0 additions & 15 deletions doc-styles/src/index.js

This file was deleted.

139 changes: 0 additions & 139 deletions doc-styles/src/styles.css

This file was deleted.

1 change: 0 additions & 1 deletion form-core/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

```js script
import { html } from '~/core';
import '~/doc-styles';
```

The form-core package is an umbrella package for form-related utilities, two examples:
Expand Down
1 change: 0 additions & 1 deletion icons/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Icon resolution manager. Ensures icons are bundled into iconsets and asynchronou

```js script
import { html } from '~/core'
import '~/doc-styles';
import '../simba-icon.js';
```

Expand Down
1 change: 0 additions & 1 deletion input-amount/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { html } from '~/core';
import { Required, Validator } from '~/form-core';
import { localize } from '~/localize';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import '~/doc-styles';
import '../simba-input-amount.js';

loadDefaultFeedbackMessages();
Expand Down
1 change: 0 additions & 1 deletion input-date/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { html } from '~/core';
import { Required, Validator } from '~/form-core';
import { localize } from '~/localize';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import '~/doc-styles';
import '../simba-input-date.js';

loadDefaultFeedbackMessages();
Expand Down
1 change: 0 additions & 1 deletion input-datepicker/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { html } from '~/core';
import { Required, Validator } from '~/form-core';
import { localize } from '~/localize';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import '~/doc-styles';
import '../simba-input-datepicker.js';

loadDefaultFeedbackMessages();
Expand Down
1 change: 0 additions & 1 deletion input-email/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { html } from '~/core';
import { Required } from '~/form-core';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import { localize } from '~/localize';
import '~/doc-styles';
import '../simba-input-email.js';

loadDefaultFeedbackMessages();
Expand Down
1 change: 0 additions & 1 deletion input-iban/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { html } from '~/core';
import { Required, Validator } from '~/form-core';
import { localize } from '~/localize';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import '~/doc-styles';
import '../simba-input-iban.js';

loadDefaultFeedbackMessages();
Expand Down
1 change: 0 additions & 1 deletion input-range/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { html } from '~/core';
import { Required, Validator } from '~/form-core';
import { localize } from '~/localize';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import '~/doc-styles';
import '../simba-input-range.js';

loadDefaultFeedbackMessages();
Expand Down
1 change: 0 additions & 1 deletion input-stepper/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { html } from '~/core';
import { Required, Validator } from '~/form-core';
import { localize } from '~/localize';
import { loadDefaultFeedbackMessages } from '@lion/validate-messages';
import '~/doc-styles';
import '../simba-input-stepper.js';

loadDefaultFeedbackMessages();
Expand Down
Loading

0 comments on commit ef53f27

Please sign in to comment.