dock-spawn-ts
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -8,5 +8,15 @@ import { DockManager } from "../DockManager.js"; | ||
import style2 from "../../../lib/css/dock-manager.css" with { type: 'css' }; | ||
function toParString(strings, values) { | ||
if (strings.length === 1) | ||
return strings.raw[0]; | ||
else { | ||
let r = ''; | ||
for (let i = 0; i < strings.length; i++) { | ||
r += strings[i] + (values[i] ?? ''); | ||
} | ||
return r; | ||
} | ||
} | ||
const css = function (strings, ...values) { | ||
const cssStyleSheet = new CSSStyleSheet(); | ||
//@ts-ignore | ||
cssStyleSheet.replaceSync(toParString(strings, values)); | ||
@@ -23,3 +33,4 @@ return cssStyleSheet; | ||
elementContainerMap = new Map(); | ||
static style = css `:host { | ||
static style = css ` | ||
:host { | ||
display: block; | ||
@@ -26,0 +37,0 @@ }`; |
{ | ||
"name": "dock-spawn-ts", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "DockSpawn Typescript Version", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -10,5 +10,16 @@ import { DockManager } from "../DockManager.js"; | ||
function toParString(strings: TemplateStringsArray, values: any[]) { | ||
if (strings.length === 1) | ||
return strings.raw[0]; | ||
else { | ||
let r = '' | ||
for (let i = 0; i < strings.length; i++) { | ||
r += strings[i] + (values[i] ?? ''); | ||
} | ||
return r; | ||
} | ||
} | ||
const css = function (strings: TemplateStringsArray, ...values: any[]): CSSStyleSheet { | ||
const cssStyleSheet = new CSSStyleSheet(); | ||
//@ts-ignore | ||
cssStyleSheet.replaceSync(toParString(strings, values)); | ||
@@ -27,3 +38,4 @@ return cssStyleSheet; | ||
static style = css`:host { | ||
static style = css` | ||
:host { | ||
display: block; | ||
@@ -30,0 +42,0 @@ }`; |
Sorry, the diff of this file is not supported yet
812505
11293