Skip to content

Commit 47a0503

Browse files
committed
add contrast color
1 parent f18c7ff commit 47a0503

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fail_fast: true
22

33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.14.1
5+
rev: v0.14.5
66
hooks:
77
- id: ruff-check
88
files: ^reflex_ui/
@@ -28,7 +28,7 @@ repos:
2828
# entry: python3 scripts/make_pyi.py
2929

3030
- repo: https://github.com/RobertCraigie/pyright-python
31-
rev: v1.1.406
31+
rev: v1.1.407
3232
hooks:
3333
- id: pyright
3434
files: ^reflex_ui/

demo/assets/css/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@
153153
--warning-a10: var(--amber-a10);
154154
--warning-a11: var(--amber-a11);
155155
--warning-a12: var(--amber-a12);
156+
/* Contrast */
157+
--primary-contrast: #ffffff;
156158
/* Radius */
157159
--radius: 0.5rem;
158160
/* Font */
@@ -211,6 +213,8 @@
211213
--color-secondary-a10: var(--secondary-a10);
212214
--color-secondary-a11: var(--secondary-a11);
213215
--color-secondary-a12: var(--secondary-a12);
216+
/* Contrast */
217+
--color-primary-contrast: var(--primary-contrast, #ffffff);
214218
/* Info */
215219
--color-info-1: var(--info-1);
216220
--color-info-2: var(--info-2);

reflex_ui/components/base/button.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
BUTTON_VARIANTS = {
2222
"variant": {
23-
"primary": "bg-primary-9 text-white hover:bg-primary-10",
24-
"destructive": "bg-destructive-9 hover:bg-destructive-10 text-white",
23+
"primary": "bg-primary-9 text-primary-contrast hover:bg-primary-10",
24+
"destructive": "bg-destructive-9 hover:bg-destructive-10 text-primary-contrast",
2525
"outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12",
2626
"secondary": "bg-secondary-4 text-secondary-12 hover:bg-secondary-5",
2727
"ghost": "hover:bg-secondary-3 text-secondary-11",

reflex_ui/components/base/button.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ LiteralButtonSize = Literal[
2222
DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border"
2323
BUTTON_VARIANTS = {
2424
"variant": {
25-
"primary": "bg-primary-9 text-white hover:bg-primary-10",
26-
"destructive": "bg-destructive-9 hover:bg-destructive-10 text-white",
25+
"primary": "bg-primary-9 text-primary-contrast hover:bg-primary-10",
26+
"destructive": "bg-destructive-9 hover:bg-destructive-10 text-primary-contrast",
2727
"outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12",
2828
"secondary": "bg-secondary-4 text-secondary-12 hover:bg-secondary-5",
2929
"ghost": "hover:bg-secondary-3 text-secondary-11",

reflex_ui/components/base/checkbox.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ class ClassNames:
1515
"""Class names for the checkbox component."""
1616

1717
ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default"
18-
INDICATOR = (
19-
"flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8"
20-
)
18+
INDICATOR = "flex text-primary-contrast data-[unchecked]:hidden data-[disabled]:text-secondary-8"
2119
LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2"
2220
CONTAINER = "flex flex-row items-center gap-2"
2321

reflex_ui/components/base/checkbox.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ from reflex_ui.components.base_ui import BaseUIComponent
1515

1616
class ClassNames:
1717
ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default"
18-
INDICATOR = (
19-
"flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8"
20-
)
18+
INDICATOR = "flex text-primary-contrast data-[unchecked]:hidden data-[disabled]:text-secondary-8"
2119
LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2"
2220
CONTAINER = "flex flex-row items-center gap-2"
2321

0 commit comments

Comments
 (0)