Skip to content

Streamline colors styles#196

Merged
kimcoleman merged 17 commits intomemberlite-7-0from
streamline-colors-styles
Feb 12, 2026
Merged

Streamline colors styles#196
kimcoleman merged 17 commits intomemberlite-7-0from
streamline-colors-styles

Conversation

@kimcoleman
Copy link
Copy Markdown
Member

@kimcoleman kimcoleman commented Feb 2, 2026

All Submissions:

Changes proposed in this Pull Request:

This PR streamlines the theme's CSS architecture by consolidating stylesheets, introducing CSS custom properties for consistent color management, and migrating hardcoded values to WordPress theme.json presets. It also introduces a centralized color system with new color schemes, automatic dark/light mode detection, and a robust migration path for existing users.

Automatic Dark/Light Mode

  • Eliminated css/dark.css and the manual memberlite_darkcss theme mod toggle
  • Added memberlite_is_dark_color() using WCAG relative luminance calculation
  • Background color luminance now automatically determines is-style-dark or is-style-light body class
  • Dark mode styles incorporated into main style.css using these body classes

Consolidated CSS Files into style.css

  • Removed css/dark.css (styles merged/replaced by luminance-based approach)
  • Removed css/memberlite-shortcodes.css (styles were already merged into main stylesheet in v6.0)
  • Removed css/theme-my-login.css (styles no longer needed separately)
  • Removed Theme My Login integration file (inc/integrations/theme-my-login.php)

Introduced CSS Custom Properties for Message/Alert Colors

  • Added :root variables for info, success, error, and alert states
  • Each state includes background, border, text, and link color variants
  • Provides single source of truth for semantic color usage across the theme and plugin integrations

Migrated to WordPress theme.json Presets

  • Replaced hardcoded font sizes with var(--wp--preset--font-size--*)
  • Replaced hardcoded spacing with var(--wp--preset--spacing--*)
  • Updated line-height to use var(--wp--custom--line-height--heading)
  • Updated css/bbpress.css to use var(--memberlite-color-borders) instead of hardcoded border colors (~20 declarations)

Refined theme.json Values

  • Adjusted border-radius from 6px to 8px
  • Updated heading line-height from 1.1 to 1.4
  • Refined fluid font size scaling with tighter clamp ranges
  • Added spacing preset "80" for larger spacing needs
  • Updated column block gap to use spacing preset
  • Set defaultPalette: false to hide WP default colors in the editor
  • Updated button outline width from 1px to 2px and button text color to use base preset
  • Added button :focus outline styling

Import/Export Improvements (adminpages/tools.php)

  • Skips obsolete memberlite_darkcss mod on import

Cleanup

  • Removed legacy browser prefixes (-webkit-box-sizing, -moz-box-sizing)

How to test the changes in this Pull Request:

  1. Activate the theme and verify all pages render correctly with expected typography and spacing roughly unchanged. There will be slightly expansion/adjustment. That is ok.
  2. Test message boxes (info, success, error, alert variants) display with correct colors
  3. Verify Memberlite shortcodes (banner, accordion, etc.) still function and style correctly
  4. Check responsive behavior at various breakpoints
  5. Test with and without Paid Memberships Pro active

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

  • ENHANCEMENT: Streamlined CSS architecture to consolidate named spacing, sizing, and colors into main style.css.
  • DEPRECATED: Removed support for Theme My Login. Memberlite is designed for PMPro, which includes native frontend login functionality.

@kimcoleman kimcoleman changed the base branch from dev to memberlite-7-0 February 4, 2026 09:19
@kimcoleman kimcoleman added this to the 7.0 milestone Feb 7, 2026
@kimcoleman kimcoleman marked this pull request as ready for review February 11, 2026 00:53
@kimcoleman kimcoleman requested a review from Copilot February 11, 2026 00:53
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors Memberlite’s styling system by consolidating CSS, moving typography/spacing to theme.json presets, and shifting dark/light styling to an automatic luminance-based approach (removing the manual dark mode toggle and related assets/integrations).

Changes:

  • Consolidate/modernize styling in style.css (custom properties for semantic message colors; convert hardcoded sizes to theme.json preset vars).
  • Add automatic dark/light detection via WCAG relative luminance (memberlite_is_dark_color) and apply is-style-dark / is-style-light plus color-scheme.
  • Remove Theme My Login integration and the legacy memberlite_darkcss theme mod (and css/dark.css).

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
theme.json Reformat and adjust presets/usages; adds caption color; reduces root spacing config.
style.css Introduces semantic alert variables, migrates many values to preset vars, and folds dark-mode behaviors into the main stylesheet.
js/customizer.js Adds luminance-based dark detection for live preview and updates color-scheme dynamically.
inc/updates.php Removes obsolete memberlite_darkcss mod during updates and bumps DB version.
inc/integrations/theme-my-login.php Removes Theme My Login integration hook/enqueue file.
inc/extras.php Switches body dark/light class logic from a theme mod toggle to luminance-based detection.
inc/defaults.php Removes the memberlite_darkcss default.
inc/customizer.php Stops exposing the dark-mode checkbox; outputs color-scheme based on luminance.
inc/colors.php Adjusts default scheme colors; adds memberlite_is_dark_color() helper.
functions.php Stops enqueuing css/dark.css and removes Theme My Login integration loading.
css/dark.css Deletes legacy dark-mode stylesheet.
css/bbpress.css Replaces hardcoded border colors with --memberlite-color-borders.
adminpages/tools.php Skips importing deprecated memberlite_darkcss theme mod.
Comments suppressed due to low confidence (1)

functions.php:750

  • PR description says css/memberlite-shortcodes.css and css/theme-my-login.css were removed, but both files still exist in the repo and (with the integration removed here) appear to be unused. Consider deleting the unused CSS files (and any references/docs) to avoid shipping dead assets and reduce maintenance overhead.
/* Integration for LifterLMS. */
if ( class_exists( 'LifterLMS' ) ) {
	require_once get_template_directory() . '/inc/integrations/lifterlms.php';
}

/* Integration for WooCommerce. */
if ( function_exists( 'is_woocommerce' ) ) {
	require_once get_template_directory() . '/inc/integrations/woocommerce.php';
}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kimcoleman kimcoleman merged commit 407ecee into memberlite-7-0 Feb 12, 2026
RachelRVasquez pushed a commit to RachelRVasquez/memberlite that referenced this pull request Mar 12, 2026
* Working on merging / consolidating colors and dark mode into main css

* Streamlining colors, spacing, and sizing to theme.json

* Color scheme more like the current Memberlite 6.1.1 default

* Resolving issue with spacing; requiring theme.json version 2, not 3 yet

* Fixing grid spacing / responsive

* Expanding spacing for archive view

* Continue styling stremlining

* All the style improvements; eliminate the dark css file and theme mod; set root scheme as light or dark based on luminance of background color

* Updating the updates db version (consolidating updates)

* Discoveries in changes introduced while pull this to live PMPro site for testing

* Resolving issue with update script and fallbacks present in dev

* Fallbacks preserved for masthead and footer widgets

* Fixing css error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants