MCPcopy Create free account
hub / github.com/microsoft/SandDance / styleToRegistration

Function styleToRegistration

docs/app/js/sanddance-app.js:22114–22138  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

22112 return allEntries.join("");
22113}
22114function styleToRegistration(options) {
22115 var args = [];
22116 for(var _i = 1; _i < arguments.length; _i++)args[_i - 1] = arguments[_i];
22117 var rules = extractRules(args);
22118 var key = getKeyForRules(options, rules);
22119 if (key) {
22120 var stylesheet = (0, _stylesheet.Stylesheet).getInstance();
22121 var registration = {
22122 className: stylesheet.classNameFromKey(key),
22123 key: key,
22124 args: args
22125 };
22126 if (!registration.className) {
22127 registration.className = stylesheet.getClassName(getDisplayName(rules));
22128 var rulesToInsert = [];
22129 for(var _a = 0, _b = rules.__order; _a < _b.length; _a++){
22130 var selector = _b[_a];
22131 rulesToInsert.push(selector, serializeRuleEntries(options, rules[selector]));
22132 }
22133 registration.rulesToInsert = rulesToInsert;
22134 }
22135 return registration;
22136 }
22137 return undefined;
22138}
22139function applyRegistration(registration, specificityMultiplier) {
22140 if (specificityMultiplier === void 0) specificityMultiplier = 1;
22141 var stylesheet = (0, _stylesheet.Stylesheet).getInstance();

Callers

nothing calls this directly

Calls 4

extractRulesFunction · 0.85
getKeyForRulesFunction · 0.85
getDisplayNameFunction · 0.85
serializeRuleEntriesFunction · 0.85

Tested by

no test coverage detected