Skip to content

Commit cfe5660

Browse files
committed
Basic setup.
1 parent 54e710a commit cfe5660

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

src/index.html renamed to index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link rel="stylesheet" href="https://use.typekit.net/kes1hoh.css">
67
<title>Demo</title>
78
</head>
89
<body>
910
<demo-app></demo-app>
10-
<script type="module" src="./app/app.ts"></script>
11+
<script type="module" src="./src/app/app.ts"></script>
1112
</body>
1213
</html>

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"version": "1.0.0",
55
"license": "Apache-2.0",
66
"private": true,
7+
"type": "module",
78
"repository": {
89
"type": "git",
910
"url": "git+https://github.com/sanomalearning/example-design-system-lit-app.git"
@@ -12,8 +13,6 @@
1213
"url": "https://github.com/sanomalearning/example-design-system-lit-app/issues"
1314
},
1415
"homepage": "https://github.com/sanomalearning/example-design-system-lit-app#readme",
15-
"main": "index.js",
16-
"type": "module",
1716
"scripts": {
1817
"start": "wireit"
1918
},

src/app/app.ts

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
import { html, LitElement, TemplateResult } from 'lit';
1+
import type { ScopedElementsMap } from '@open-wc/scoped-elements';
2+
import type { CSSResultGroup, TemplateResult } from 'lit';
3+
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
4+
import { Button } from '@sanomalearning/slds-core/button';
5+
import { css, html, LitElement } from 'lit';
6+
7+
export class App extends ScopedElementsMixin(LitElement) {
8+
static get scopedElements(): ScopedElementsMap {
9+
return {
10+
'sl-button': Button
11+
};
12+
}
13+
14+
static styles: CSSResultGroup = css`
15+
:host { display: block; }
16+
`;
217

3-
export class App extends LitElement {
418
render(): TemplateResult {
5-
return html`HELLO WORLD!`;
19+
return html`
20+
<h1>Sanoma Learning Design System Demo App</h1>
21+
<h2>Using <a href="https://lit.dev">Lit</a></h2>
22+
<sl-button>Button</sl-button>
23+
`;
624
}
725
}
826

web-dev-server.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { esbuildPlugin } from '@web/dev-server-esbuild';
22

33
export default {
4+
appIndex: './index.html',
45
nodeResolve: {
56
exportConditions: ['development']
67
},
7-
appIndex: './src/index.html',
8-
rootDir: 'src',
98
plugins: [esbuildPlugin({ ts: true, target: 'auto' })]
109
};

0 commit comments

Comments
 (0)