MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / Options

Interface Options

bindings/javascript/js-binding.d.ts:9–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7export declare function inlineFragment(html: string, css: string, options?: Options | undefined | null): string
8
9export interface Options {
10 /**
11 * Whether to inline CSS from "style" tags.
12 *
13 * Sometimes HTML may include a lot of boilerplate styles, that are not applicable in every
14 * scenario, and it is useful to ignore them and use `extra_css` instead.
15 */
16 inlineStyleTags?: boolean
17 /** Keep "style" tags after inlining. */
18 keepStyleTags?: boolean
19 /** Keep "link" tags after inlining. */
20 keepLinkTags?: boolean
21 /** Keep "at-rules" after inlining. */
22 keepAtRules?: boolean
23 /** Remove trailing semicolons and spaces between properties and values. */
24 minifyCss?: boolean
25 /** Used for loading external stylesheets via relative URLs. */
26 baseUrl?: string
27 /** Whether remote stylesheets should be loaded or not. */
28 loadRemoteStylesheets?: boolean
29 /** An LRU Cache for external stylesheets. */
30 cache?: StylesheetCache
31 /** Additional CSS to inline. */
32 extraCss?: string
33 /**
34 * Pre-allocate capacity for HTML nodes during parsing.
35 * It can improve performance when you have an estimate of the number of nodes in your HTML document.
36 */
37 preallocateNodeCapacity?: number
38 /** Remove selectors that were successfully inlined from inline `<style>` blocks. */
39 removeInlinedSelectors?: boolean
40 /**
41 * Apply `width` HTML attributes from CSS `width` properties on supported elements.
42 *
43 * This is useful for email compatibility with clients like Outlook that ignore CSS width.
44 * Supported elements: `table`, `td`, `th`, `img`.
45 */
46 applyWidthAttributes?: boolean
47 /**
48 * Apply `height` HTML attributes from CSS `height` properties on supported elements.
49 *
50 * This is useful for email compatibility with clients like Outlook that ignore CSS height.
51 * Supported elements: `table`, `td`, `th`, `img`.
52 */
53 applyHeightAttributes?: boolean
54}
55
56export interface StylesheetCache {
57 /** Cache size. */

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected