Download the PHP package ernestdefoe/theme-toggle without Composer

On this page you can find all versions of the php package ernestdefoe/theme-toggle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package theme-toggle

Theme Toggle

Floxum Version Downloads Review License

A small, theme-agnostic day/night/system picker for the Flarum 2 header. Drops into any Flarum 2 theme that respects the native <html data-theme="…"> signal (every theme that ships with or extends Flarum 2 does, including the default).

License Flarum PHP TypeScript

Screenshots

Desktop — header button

A compact icon button next to Search / Sign Up / Log In. The icon reflects the active choice (☾ dark, ☀ light, ◐ system).

Desktop — dropdown open

Five choices, each with a matching icon. The active choice is marked with a checkmark.

Mobile — slide-out drawer

On phone-width viewports Flarum re-renders HeaderSecondary inside .App-drawer. The button switches to a labeled, full-width menu row so it lines up with Search / Sign Up / Log In.

Features

Compatibility

Install

Then enable Theme Toggle from the admin panel's Extensions page.

Development

The TypeScript path mapping in js/tsconfig.json points at ../vendor/flarum/core/js/dist-typings/, so composer install at the repo root must run before check-typings can resolve flarum/* imports.

Project layout

How it works

Flarum 2 ships four data-theme values: light, light-hc, dark, and dark-hc. Themes are expected to define their dark tokens as the default and their light tokens under [data-theme^='light'], with a high-contrast layer under [data-theme^='light-hc'] / [data-theme^='dark-hc']. Because those selectors use ^= (prefix match), setting data-theme="light-hc" activates both the regular light palette and its HC overrides via the cascade.

This extension just sets that attribute client-side:

No theme-specific CSS, no setting payload, no server round-trip.

Translations

Override any string by adding the matching key under ernestdefoe-theme-toggle.forum.toggle.* in your forum's locale file:

Key Default
label Theme
option_dark Dark
option_dark_hc Dark (high contrast)
option_light Light
option_light_hc Light (high contrast)
option_system System

License

MIT © Ernest Defoe


All versions of theme-toggle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
flarum/core Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ernestdefoe/theme-toggle contains the following files

Loading the files please wait ...