mirror of
https://github.com/rsms/inter.git
synced 2024-11-26 23:56:59 +03:00
Adds color names sample to the website lab
This commit is contained in:
parent
05bfd6acf8
commit
6daae9e591
1
docs/lab/color-names.json
Normal file
1
docs/lab/color-names.json
Normal file
File diff suppressed because one or more lines are too long
@ -320,6 +320,30 @@ samples.set('Symbols', `
|
|||||||
\uE004 White Component instance (private-area, U+E004)
|
\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 ──────', null)
|
||||||
|
|
||||||
samples.set('Body text 1', `
|
samples.set('Body text 1', `
|
||||||
|
Loading…
Reference in New Issue
Block a user