Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 36 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,54 @@
</p>
</div>

CSS Loader Companion connects the CSS Loader desktop app to Steam. It loads the
last generated CSS at Millennium startup, layers it over the selected
Millennium theme, and keeps Big Picture and Steam's isolated side-menu views in
sync.
CSS Loader Companion connects the CSS Loader desktop app to Steam. It applies
the app's ordered, resolved CSS injects directly over the selected Millennium
theme and keeps Big Picture and Steam's isolated side-menu views in sync.

## Version 1.0

Version 1.0 is the first stable release of the official in-Steam companion for
CSS Loader for Millennium.

### Main highlights

- Applies CSS Loader's resolved CSS directly as ordered `<style>` elements.
- Preserves exact CSS text instead of loading converted or rewritten bundles.
- Reconciles additions, changes, removals, and cascade order every time the
desktop backend publishes a new revision.
- Covers Desktop, Big Picture, popups, Quick Access, Main Menu, and notification
BrowserViews.
- Uses Millennium's controlled in-process APIs and per-plugin CDP proxy without
exposing an external debugging port.
- Keeps the user's selected Millennium theme active and layers CSS Loader after
it.
- Validates matching protocol versions and content hashes before applying new
state.
- Removes stale legacy bundle links during migration to the direct runtime.

The companion intentionally remains lightweight: theme parsing, store access,
downloads, profiles, dependencies, and configuration continue to belong to the
CSS Loader desktop app and backend.

> [!IMPORTANT]
> This plugin is one component of
> [CSS Loader for Millennium](https://github.com/DevsNate/CSSLoader-Millennium).
> For a new installation, use the complete desktop installer. It creates the
> theme library, installs the backend, installs this companion, and generates
> the local CSS asset host automatically.
> theme library, installs the backend, installs this companion, and publishes
> the local runtime state automatically.

## What it does

- Loads generated CSS as part of Millennium, before Steam's interface becomes
visible.
- Applies resolved CSS as individual style elements without bundle conversion
or asset-URL rewriting.
- Keeps the user's selected Millennium theme active and places CSS Loader last
in the cascade.
- Synchronizes Desktop, Big Picture, Quick Access, Main Menu, and notification
documents.
- Uses Millennium's in-process APIs; it does not require Steam `-dev` mode, an
external CDP port, or `.cef-enable-remote-debugging`.
- Continues applying the last compiled profile while the desktop app and
backend are closed.
- Reconciles additions, changes, removals, and cascade order from the app's
direct runtime state.

## Installation

Expand All @@ -41,8 +65,8 @@ The complete installer configures this plugin automatically and preserves the
currently selected Millennium theme.

If this companion is installed from Millennium first, its panel will wait for
the desktop app. Opening the complete app finishes setup and generates the
user-specific CSS files.
the desktop app. Opening the complete app finishes setup and publishes the
user-specific runtime state.

## Development

Expand Down
29 changes: 29 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# CSS Loader Companion for Millennium 1.0.0

Version 1.0 is the first stable release of the official Millennium companion
for CSS Loader for Millennium.

## Highlights

- Directly applies CSS Loader's ordered, resolved CSS without bundle conversion
or asset-URL rewriting.
- Preserves inline SVG, data URLs, animations, masks, filters, generated
variables, and CSS cascade behavior.
- Synchronizes Desktop, Big Picture, popups, Quick Access, Main Menu, and
notification documents.
- Uses Millennium's supported in-process APIs and controlled per-plugin CDP
proxy; no Steam `-dev` mode or external debugging port is required.
- Reconciles changed, removed, and reordered injections live.
- Rejects incomplete updates unless the runtime state and revision hashes match.
- Cleans up legacy generated-bundle links during migration.

## Advantages

- Existing CSS Loader themes do not need Millennium-specific conversion.
- The selected Millennium theme remains active underneath CSS Loader.
- Theme parsing, profiles, dependencies, store access, and downloads stay in the
desktop app, keeping this plugin small and focused.
- Exact CSS delivery avoids compiler edge cases with complex third-party themes.

This plugin is designed to be installed through the complete CSS Loader for
Millennium desktop installer, which bundles the matching backend and companion.
12 changes: 12 additions & 0 deletions backend/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ local REPORT_FILE = fs.join(
"build-report.json"
)

local STATE_FILE = fs.join(
millennium.steam_path(),
"millennium",
"themes",
"CSS Loader",
"runtime-state.json"
)

local function read_file(path)
local file = io.open(path, "rb")
if not file then return "" end
Expand All @@ -22,6 +30,10 @@ function get_css_loader_revision()
return read_file(REPORT_FILE)
end

function get_css_loader_state()
return read_file(STATE_FILE)
end

local function on_load()
logger:info("CSS Loader Companion loaded")
millennium.ready()
Expand Down
Loading