storybook setup and styling
This commit is contained in:
committed by
Jacob Overgaard
parent
c33f9852d6
commit
e68f25575e
4
src/Umbraco.Web.UI.Client/.storybook/preview-body.html
Normal file
4
src/Umbraco.Web.UI.Client/.storybook/preview-body.html
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<script>
|
||||||
|
document.body.classList.add('uui-font');
|
||||||
|
document.body.classList.add('uui-text');
|
||||||
|
</script>
|
||||||
22
src/Umbraco.Web.UI.Client/.storybook/preview-head.html
Normal file
22
src/Umbraco.Web.UI.Client/.storybook/preview-head.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<style>
|
||||||
|
body {
|
||||||
|
padding: 0px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
window.addEventListener('load', () => {
|
||||||
|
var body = document.querySelector('body');
|
||||||
|
window.addEventListener('keydown', (e) => {
|
||||||
|
if (e.ctrlKey === true && e.key === 'g') {
|
||||||
|
if (body.hasAttribute('baseline-grid')) {
|
||||||
|
body.removeAttribute('baseline-grid');
|
||||||
|
} else {
|
||||||
|
body.setAttribute('baseline-grid', '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
|
import '@umbraco-ui/uui-css/dist/uui-css.css';
|
||||||
|
import '@umbraco-ui/uui';
|
||||||
|
|
||||||
export const parameters = {
|
export const parameters = {
|
||||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||||
controls: {
|
controls: {
|
||||||
matchers: {
|
matchers: {
|
||||||
color: /(background|color)$/i,
|
color: /(background|color)$/i,
|
||||||
date: /Date$/,
|
date: /Date$/,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { Story, Meta } from '@storybook/web-components';
|
import { Story, Meta } from '@storybook/web-components';
|
||||||
import { html } from 'lit';
|
import { html } from 'lit-html';
|
||||||
import './installer.element';
|
import './installer.element';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Installer/Installer',
|
title: 'Installer/Installer',
|
||||||
|
component: 'umb-installer',
|
||||||
|
id: 'installer',
|
||||||
} as Meta;
|
} as Meta;
|
||||||
|
|
||||||
const Template: Story = () => html`<umb-installer></umb-installer>`;
|
const Template: Story = () => html`<umb-installer></umb-installer>`;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Story, Meta } from '@storybook/web-components';
|
import { Story, Meta } from '@storybook/web-components';
|
||||||
import { html } from 'lit';
|
import { html } from 'lit-html';
|
||||||
import './upgrader.element';
|
import './upgrader.element';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
Reference in New Issue
Block a user