Skip to content
ChartForgeX
Class

HtmlStrictStyles

ChartForgeX.Html

Namespace
ChartForgeX.Html
Assembly
ChartForgeX
Modifiers
static

Moves the inline styles of ChartForgeX HTML into one stylesheet, for pages whose content security policy allows styles only from nonce'd style elements.

Inheritance

  • object
  • HtmlStrictStyles

Remarks

Every style attribute becomes a generated class (cfx-s- followed by a hash of its declarations), and its declarations become a rule in the stylesheet. The rule repeats the class three times so it outranks the renderers' own stylesheet rules, as the attribute did. Every style element joins the same stylesheet; a media attribute becomes an @media block. Script and raw-text contents are copied unchanged. The interactive runtimes move the generated classes back to inline styles through the CSS object model when they mount, which a strict policy allows, so scripts that read or replace inline styles behave as before.

Methods

public static HtmlStrictStyleFragment Extract(string html) #

Splits ChartForgeX HTML into markup without inline styles and the stylesheet that replaces them.

Parameters

html string required
A fragment or document produced by a ChartForgeX renderer.

Returns

HtmlStrictStyleFragment The markup and its stylesheet. Equal declarations share one class, also across fragments of one page.

Fields

public const string ClassPrefix #

The prefix of the generated class names.

Value: cfx-s-