Skip to content

Change legend labels text color according to dark/light theme #15

@davide-granello

Description

@davide-granello

Hello, i want to change the legend labels text color according to the theme.
I'm currently setting the color like this:

public function configure(NovaRequest $request): void
  {
    // ... other settings
    
    $this->legend([
      'position' => 'left',
      'labels' => [
        'color' => 'rgb(148,163,184)' // static value not linked to current light/dark mode
      ]
    ]);
  }

A ChartJsWidget class variable like $themeColor would be useful in order to change some settings depending on that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions