diff options
author | Rasmus Andersson <rasmus@notion.se> | 2017-09-29 19:08:56 +0300 |
---|---|---|
committer | Rasmus Andersson <rasmus@notion.se> | 2017-09-29 19:08:56 +0300 |
commit | 6daae9e5913515dc566a8f32df253f47313d9fec (patch) | |
tree | 0c0d5c0e8658188efce66d81337cd9b63fb80136 /docs/lab/index.html | |
parent | 05bfd6acf811a29eeaf93f4b6a63f8bf74e1863c (diff) | |
download | inter-6daae9e5913515dc566a8f32df253f47313d9fec.tar.xz |
Adds color names sample to the website lab
Diffstat (limited to 'docs/lab/index.html')
-rw-r--r-- | docs/lab/index.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/lab/index.html b/docs/lab/index.html index e9b325d92..d1737f1ff 100644 --- a/docs/lab/index.html +++ b/docs/lab/index.html @@ -320,6 +320,30 @@ samples.set('Symbols', ` \uE004 White Component instance (private-area, U+E004) `) + +samples.set('Color names', { + _cachedHTML: null, + _isFetching: false, + toHTML() { + if (this._cachedHTML) { + return this._cachedHTML + } + fetch('color-names.json').then(r => r.json()).then(names => { + if (!this._cachedHTML) { + let namestr = names.join('\n') + let r = document.createElement('div') + r.innerText = namestr + this._cachedHTML = r.innerHTML + } + if (sampleVar) { + sampleVar.refreshValue(null) + } + }) + + return 'fetching color names...' + }, +}) + samples.set('────── body ──────', null) samples.set('Body text 1', ` |