=== Remember Admin Login Colors ===
Contributors: scottweiss, somethumb
Tags: login, admin, color scheme, customization
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.5.0
Donate link: https://https://plugins.somethumb.net/donate/
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Makes the WordPress login screen match the last logged-in user's admin color scheme on that browser.

== Description ==

After a successful login, the plugin remembers that user's selected WordPress admin color scheme in a secure browser cookie. The next time that browser displays wp-login.php, the login page uses the remembered colors.

Features:

* Supports all nine bundled WordPress admin color schemes.
* Reads colors from WordPress's registered admin schemes instead of maintaining copied palettes.
* Remembers the most recently logged-in user's scheme per browser/device.
* Updates immediately when a user changes their own admin color scheme.
* Applies matching colors to login, lost-password, reset-password, registration, notices, links, inputs, buttons, checkboxes, and login help controls.
* Uses a standard enqueued stylesheet for the plugin's login color rules.
* Allows developers to replace the plugin's default login color stylesheet from the active theme.
* Automatically loads an optional style-login.css from the active theme after the ralc color stylesheet.
* Preserves WordPress's native login layout, shadows, radii, and logo presentation.
* Falls back to the standard Fresh scheme on a browser's first visit.
* No settings screen or database options required.

== Installation ==

1. Upload the plugin ZIP through Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Log in once. The selected admin color scheme will be remembered for future login screens on that browser.

== Frequently Asked Questions ==

= Why is the first login screen still the standard WordPress color? =

Before the first successful login, WordPress does not know which user's colors to use. After login, the plugin remembers the scheme in that browser for one year.

= What happens on a shared computer? =

The login page uses the scheme of the most recent user who successfully logged in with that browser.

= Does this track the user across devices? =

No. Each browser/device remembers its own last-used scheme.

= Can I customize how the remembered color scheme is applied? =

Yes. Copy the plugin's default stylesheet:

assets/css/login-colors.css

to the following location in the active theme:

ralc/login-colors.css

The theme copy completely replaces the plugin's default login color stylesheet and will not be overwritten when the plugin is updated.

= Can I add other login page styling? =

Yes. The plugin also supports an optional style-login.css file in the active theme.

Use ralc/login-colors.css when you want to customize how the remembered admin color scheme is applied.

Use style-login.css for additional site-specific login customization such as logo sizing, layout, typography, spacing, and other presentation changes.

== Screenshots ==

1. Login screen using the remembered Midnight admin color scheme.
2. Login screen using the remembered Ocean admin color scheme.
3. Login screen using the remembered Sunrise admin color scheme.

== Customizing the Login Styles ==

Remember Admin Login Colors includes a default login stylesheet that uses the colors from the remembered WordPress admin color scheme.

Developers can customize these styles without modifying the plugin files.

= Replacing the plugin color stylesheet =

The plugin's default stylesheet is located at:

assets/css/login-colors.css

To customize it, copy the file to the active theme using the following location:

ralc/login-colors.css

For example:

wp-content/themes/your-theme/ralc/login-colors.css

The theme copy completely replaces the plugin's standard login color stylesheet. This allows developers to modify how the remembered color scheme is applied without editing plugin files.

Because the customized stylesheet is stored in the theme, plugin updates will not overwrite these changes.

The plugin continues to generate the remembered admin color values dynamically and makes them available through the following CSS custom properties:

* --ralc-page
* --ralc-panel
* --ralc-text
* --ralc-primary
* --ralc-hover
* --ralc-button-text

These variables can be used anywhere in the replacement stylesheet.

= Additional theme login styling =

The plugin also supports an optional:

style-login.css

file in the active theme.

The two stylesheets serve different purposes:

* ralc/login-colors.css is a complete replacement for the plugin's standard login color stylesheet. A developer copies it into the theme and modifies it.
* style-login.css remains the site's final login stylesheet and can be used for additional customization beyond the plugin's color scheme, including logo sizing, layout, typography, spacing, and other site-specific styling.

When both files are present, the stylesheet order is:

1. WordPress login styles.
2. The ralc login color stylesheet, either the plugin copy or the theme replacement.
3. The theme's optional style-login.css file.

This allows style-login.css to provide final site-specific overrides.

== Changelog ==

= 1.5.0 =

* Rename the plugin to Remember Admin Login Colors.
* Rename internal RACL identifiers to RALC for consistency with the new plugin name.

= 1.4.1 =

* Fix primary button text and checked checkbox colors when using the Fresh admin color scheme.
* Use white for primary button text and checkbox checkmarks instead of deriving those colors from admin icon colors.

= 1.4.0 =

* Move the plugin's static login color rules into an enqueued assets/css/login-colors.css stylesheet.
* Generate only the remembered admin color CSS variables dynamically using the WordPress inline-style API.
* Add support for a complete theme override at ralc/login-colors.css.
* Preserve support for an optional theme style-login.css file as the final login stylesheet.
* Apply remembered scheme colors to checked login form checkboxes.
* Apply remembered scheme colors to login help and tooltip focus states.
* Document the new theme stylesheet customization system.

= 1.3.5 =

* Verify the WordPress profile nonce before processing submitted admin color scheme data.
* Replace directly printed login CSS with the WordPress stylesheet enqueue and inline-style APIs.

= 1.3.4 =

* Preserve and reuse an existing style-login.css handle so attached inline logo CSS is retained.
* Preserve the original handle's dependencies, version, media, and registered data.
* Add an explicit primary-button focus-visible scheme-color override.

= 1.3.3 =

* Detect existing theme login stylesheets by the style-login.css path instead of assuming a specific handle.
* Use a plugin-owned handle for the final, single stylesheet load.

= 1.3.2 =

* Override primary-button focus and active states with remembered scheme colors.
* Apply the registered scheme colors to both layers of the keyboard focus ring.

= 1.3.1 =

* Reuse an existing style-login handle instead of loading the theme stylesheet twice.
* Defer an already-enqueued style-login stylesheet so it still loads once, after the generated colors.

= 1.3.0 =

* Detect and load style-login.css from the active child or parent theme when present.
* Load the optional theme stylesheet after the generated scheme styles so it can override them.
* Use the stylesheet modification time for automatic browser cache busting.

= 1.2.0 =

* Remove all reliance on WordPress's global wp-admin-theme-color variables.
* Apply login colors directly from the remembered profile scheme's registered values.
* Prevent the login page's Fresh variables from influencing plugin colors.

= 1.1.2 =

* Load the remembered admin scheme stylesheet after WordPress's core login stylesheet.
* Prevent the login page's Fresh CSS variables from overriding the remembered scheme.

= 1.1.1 =

* Remove all hard-coded palette fallback colors.
* Use registered scheme swatches and icon colors exclusively.
* Leave native login colors unchanged when a third-party scheme has incomplete registered color data.

= 1.1.0 =

* Use WordPress's registered admin color scheme data as the palette source.
* Load the selected scheme's own core stylesheet and use its native CSS variables.
* Derive the login background, panel, and readable text colors from the registered scheme swatches.

= 1.0.3 =

* Remove decorative shadows, rounded corners, logo effects, and other non-color styling.
* Limit the plugin to adapting the native login screen's colors.

= 1.0.2 =

* Print the dynamic stylesheet through login_head for reliable placement in the login page document.

= 1.0.1 =

* Use a site-wide cookie path so wp-login.php can always read the remembered scheme.
* Synchronize the cookie during authenticated admin visits for greater host compatibility.
* Load login styling late to avoid being overridden by other login customizations.

= 1.0.0 =

* Initial release.
