How to Apply Background Colors to Tables

Created on 10 February 2024, 11 months ago
Updated 27 June 2024, 6 months ago

Problem/Motivation

Table background color odd-even doesn’t work.

Steps to reproduce

Proposed resolution

Extra rules in subtheme-css

Remaining tasks

User interface changes

API changes

Data model changes

Hello Alaa,
I made extra rules in the subtheme.css See screenshot rule 107-115. This works and I can make my own colors. Without this rules it doesn’t work also injection of w3-striped was overruled.
I’am intent to go in production tomorrow with this site. From drupal 9 with MAYO to drupal 10 with SOLO.
multivocaal.nl

Thanks for your great job

💬 Support request
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands tzsl

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tzsl
  • Assigned to flashwebcenter
  • Status changed to Fixed 11 months ago
  • 🇺🇸United States flashwebcenter Austin TX

    It seems like you've found a solution by adding specific rules in your subtheme.css that targets the rows for striping and applies the colors you want. Also You can use the defined variable for page-wrapper.

    .solo-table-all th {--r-bg:#0b1b39;--r-tx:#e2ebfa;}
    .solo-table-all tr:nth-child(even) {--r-bg:#b8caf9;}
    .solo-table-all tr:nth-child(odd) {--r-bg:#5385df;}

    Good luck with your production deployment! It's always exciting to launch a new or updated site, and If you have any last-minute concerns or questions, feel free to ask.

    Best Wishes,
    Alaa

  • 🇺🇸United States flashwebcenter Austin TX

    I've introduced three variables to customize table backgrounds within the theme. These can be adjusted through Solo settings at your-site.com/admin/appearance/settings/solo. Navigate to "Global Site" and then use the CSS Injector to tailor these variables as desired:
    #page-wrapper { --solo-odd: white; --solo-even: #f1f1f1; --solo-thead: gray; }

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇺🇸United States flashwebcenter Austin TX
Production build 0.71.5 2024