/** * Merging two inline `style` strings, declaration by declaration. * * The split follows the CSS Syntax Level 3 tokenizer far enough to find the * declaration boundaries a browser finds: * - a `;` ends a declaration only at the top level - not inside a "..." or '...' * string, a comment, or a (...), [...] or {...} block, so `url(a;b)`, * `url("data:image/png;base64,...")` and `var(--x, url(a;b))` stay whole; * - a declaration is split at its FIRST top-level `:`, so a value such as * `url(http://x/y.png)` keeps every later colon; * - a backslash escapes the next code point everywhere (`\;`, `\"`), and inside a * string a backslash before a newline is a line continuation; an unescaped * newline ends a string (the tokenizer's bad-string), as it does in a browser; * - comments are dropped from property names; values are kept verbatim. * * This works on the attribute's value - the text after HTML character references * are resolved - so it is the CSS layer only. * * Property names compare ASCII case-insensitively (`COLOR` overrides `color`); * custom properties (`--name`) compare case-sensitively, as CSS defines them. A * declaration with no name or no colon is dropped, as a browser drops it; an * empty value is dropped too, except for a custom property, where it is valid. * The value, including any `!important`, is carried as written. */ interface Style_Declaration { name: string; value: string; } /** The declarations of an inline style string, in order. */ export declare function parse_style_declarations(style: string): Style_Declaration[]; /** * `base` merged with `extra`, declaration by declaration, as one style string. * Where both set a property, `extra` wins when `extra_wins` is true, otherwise * `base` does. The result reads as the browser reads the two strings written * loser-then-winner: * - the losing side's remaining declarations come first and the winner's after * them, so a losing shorthand (`background`) cannot reset a longhand the winner * set (`background-image`); * - a later declaration replaces an earlier one of the same property, except that * a normal declaration does not replace an `!important` one. */ export declare function merge_style(base: string, extra: string, extra_wins: boolean): string; export {}; //# sourceMappingURL=style-merge.d.ts.map