Comparing version 0.0.2 to 0.0.3
@@ -31,3 +31,3 @@ import { PartialObject, Pojo } from './types'; | ||
addSelectors(sheet: Stylesheet, resolvedSymbols: Pojo): void; | ||
scopeSelector(sheet: Stylesheet, selector: string, ast: SelectorAstNode): string; | ||
scopeSelector(sheet: Stylesheet, ast: SelectorAstNode): string; | ||
handleClass(sheet: Stylesheet, node: SelectorAstNode, name: string): Stylesheet; | ||
@@ -34,0 +34,0 @@ handleElement(sheet: Stylesheet, node: SelectorAstNode, name: string): any; |
@@ -109,3 +109,3 @@ "use strict"; | ||
return _a = {}, | ||
_a[this.scopeSelector(sheet, aSelector, ast)] = processedRules, | ||
_a[this.scopeSelector(sheet, ast)] = processedRules, | ||
_a; | ||
@@ -125,3 +125,3 @@ var _a; | ||
}; | ||
Generator.prototype.scopeSelector = function (sheet, selector, ast) { | ||
Generator.prototype.scopeSelector = function (sheet, ast) { | ||
var _this = this; | ||
@@ -157,2 +157,4 @@ var current = sheet; | ||
} | ||
/* do nothing */ | ||
return undefined; | ||
}); | ||
@@ -159,0 +161,0 @@ return parser_1.stringifySelector(ast); |
@@ -19,2 +19,2 @@ import { Stylesheet, Generator, Resolver, Config } from '../index'; | ||
} | ||
export declare function createStyleableStylesheet(config?: object): StylesheetWithContext; | ||
export declare function createStyleableStylesheet(): StylesheetWithContext; |
@@ -41,2 +41,3 @@ "use strict"; | ||
}); | ||
style.$theme = theme; | ||
document.head.appendChild(this.style); | ||
@@ -48,3 +49,3 @@ }; | ||
exports.StylableContext = StylableContext; | ||
function createStyleableStylesheet(config) { | ||
function createStyleableStylesheet() { | ||
return _a = (function (_super) { | ||
@@ -55,3 +56,2 @@ __extends(StylableStylesheet, _super); | ||
_this.styleDef = styleDef; | ||
_this._kind = "Stylesheet"; | ||
_this.namespace = _this.namespace || ('s' + (StylableContext.globalSheetCounter++)); | ||
@@ -58,0 +58,0 @@ StylableStylesheet.context.add(_this); |
@@ -23,2 +23,3 @@ import { Import } from './import'; | ||
root: string; | ||
_kind: string; | ||
constructor(cssDefinition: CSSObject, namespace?: string); | ||
@@ -25,0 +26,0 @@ static fromCSS(css: string, namespace?: string): Stylesheet; |
@@ -17,2 +17,3 @@ "use strict"; | ||
if (namespace === void 0) { namespace = ""; } | ||
this._kind = "Stylesheet"; | ||
this.cssDefinition = cssDefinition; | ||
@@ -81,2 +82,3 @@ this.classes = {}; | ||
} | ||
return undefined; | ||
}); | ||
@@ -83,0 +85,0 @@ _this.addTypedClasses(selector, isSimpleSelector); |
{ | ||
"name": "stylable", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
@@ -103,3 +103,3 @@ import { PartialObject, Pojo } from './types'; | ||
return { | ||
[this.scopeSelector(sheet, aSelector, ast)]: processedRules | ||
[this.scopeSelector(sheet, ast)]: processedRules | ||
}; | ||
@@ -117,3 +117,3 @@ | ||
} | ||
scopeSelector(sheet: Stylesheet, selector: string, ast: SelectorAstNode): string { | ||
scopeSelector(sheet: Stylesheet, ast: SelectorAstNode): string { | ||
let current = sheet; | ||
@@ -144,2 +144,4 @@ let typedClass: string; | ||
} | ||
/* do nothing */ | ||
return undefined; | ||
}); | ||
@@ -146,0 +148,0 @@ return stringifySelector(ast); |
@@ -28,2 +28,3 @@ import { Stylesheet, Generator, Resolver, Config } from '../index'; | ||
}); | ||
style.$theme = theme; | ||
document.head.appendChild(this.style); | ||
@@ -33,7 +34,6 @@ } | ||
export function createStyleableStylesheet(config?: object): StylesheetWithContext { | ||
export function createStyleableStylesheet(): StylesheetWithContext { | ||
return class StylableStylesheet extends Stylesheet { | ||
static context = new StylableContext({ namespaceDivider: "▪" }); | ||
_kind = "Stylesheet"; | ||
get(name: string) { | ||
@@ -40,0 +40,0 @@ const n = this.classes[name]; |
@@ -37,2 +37,3 @@ import { Import } from './import'; | ||
root: string; | ||
_kind = "Stylesheet"; | ||
constructor(cssDefinition: CSSObject, namespace: string = "") { | ||
@@ -91,2 +92,3 @@ this.cssDefinition = cssDefinition; | ||
} | ||
return undefined; | ||
}); | ||
@@ -93,0 +95,0 @@ this.addTypedClasses(selector, isSimpleSelector); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
257002
4536