class FrontendServiceProvider extends AbstractServiceProvider

Properties

protected Application $container from AbstractServiceProvider

Methods

__construct( Application $app)

No description

void
register()

No description

void
boot( Container $container, Dispatcher $events, Factory $views)

No description

void
addBaseCss( SourceCollector $sources)

No description

static string
computeDarkBodyBg(string $hex)

Compute the dark-mode body background colour from the forum's secondary colour hex.

static string
bundledFontUrl( Container $container, string $file)

The URL of a bundled Font Awesome webfont, stamped with the same revision the compiled stylesheet gives it.

Details

__construct( Application $app)

Parameters

Application $app

void register()

Return Value

void

void boot( Container $container, Dispatcher $events, Factory $views)

Parameters

Container $container
Dispatcher $events
Factory $views

Return Value

void

void addBaseCss( SourceCollector $sources)

Parameters

SourceCollector $sources

Return Value

void

static string computeDarkBodyBg(string $hex)

Compute the dark-mode body background colour from the forum's secondary colour hex.

Mirrors the LESS formula: hsl(@secondary-hue, min(20%, @secondary-sat), 10%). Also used by the layout of the standalone pages (errors, password reset...), which have no compiled stylesheet to take it from.

Parameters

string $hex

Return Value

string

static protected string bundledFontUrl( Container $container, string $file)

The URL of a bundled Font Awesome webfont, stamped with the same revision the compiled stylesheet gives it.

LessCompiler::finalize() appends `?v=<hash of the font file>` to every font URL in the CSS, so a changed font is a new URL. Anything else that points at the same font has to carry that revision too, or the browser treats it as a different file. The revision comes from the assets, which read the same file the stylesheet's revision comes from.

Parameters

Container $container
string $file

Return Value

string