NativeScript / NativeScript/tailwind

dark: not working

Open
#187 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
161
Forks
29
Avg merge
1h 39m
Merged PRs (30d)
1

Description

Can anyone help me understand this statement in the readme

 // use the .ns-dark class to control dark mode (applied by NativeScript) - since 'media' (default) is not supported.
      darkMode: ['class', '.ns-dark'],

As when i use

bg-teal-500 dark:bg-cyan-700

for example , the styling does not get applied when using dark mode on the phone, only the default bg-teal-500 is ever applied .
I even added it as a plugin in the config

  plugins: [
        plugin(function ({ addVariant }) {
          addVariant('android', '.ns-android &');
          addVariant('ios', '.ns-ios &');
          addVariant('dark','.ns-dark &')
        }),
      ],

still no Joy. What am i doing wrong

Thanks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README's darkMode statement and the Tailwind config shown in the report. Reproduce the bg-teal-500/dark:bg-cyan-700 example on a phone, then trace whether the .ns-dark variant is applied. Done means the dark variant visibly overrides the default styling in dark mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, tailwindcss
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.