FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: add URL fragment note for color/labelColor in badges (#2922) · npmx-dev/npmx.dev@d594f21 · GitHub

Commit d594f21

Browse files
authored
docs: add URL fragment note for color/labelColor in badges (#2922)
1 parent 78c8a47 commit d594f21

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎docs/content/2.guide/6.badges.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,29 @@ Overrides the default label color. You can pass a standard hex code (with or wit
8787
- **Default**: `#0a0a0a`
8888
- **Usage**: `?labelColor=HEX_CODE`
8989

90+
::note
91+
In URLs, `#` starts the fragment part. If you write `?labelColor=#000000`, the `#000000` part is treated as a fragment and the query value is lost.
92+
93+
- Wrong: `.../badge/version/nuxt?labelColor=#000000`
94+
- Correct (URL-encoded `#`): `.../badge/version/nuxt?labelColor=%23000000`
95+
- Also correct (no prefix): `.../badge/version/nuxt?labelColor=000000`
96+
::
97+
9098
### `color`
9199

92100
Overrides the default strategy color. You can pass a standard hex code (with or without the `#` prefix). The text color is automatically chosen (black or white) based on WCAG contrast ratio, so the badge remains readable.
93101

94102
- **Default**: Depends on the badge type (e.g., version is blue, downloads are orange).
95103
- **Usage**: `?color=HEX_CODE`
96104

105+
::note
106+
In URLs, `#` starts the fragment part. If you write `?color=#000000`, the `#000000` part is treated as a fragment and the query value is lost.
107+
108+
- Wrong: `.../badge/version/nuxt?color=#000000`
109+
- Correct (URL-encoded `#`): `.../badge/version/nuxt?color=%23000000`
110+
- Also correct (no prefix): `.../badge/version/nuxt?color=000000`
111+
::
112+
97113
| Example | URL |
98114
| :------------- | :------------------------------------ |
99115
| **Hot Pink** | `.../badge/version/nuxt?color=ff69b4` |

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL