From 262787cf3ea3a7cc5a40c7c9e4f6f9212e8c6aa6 Mon Sep 17 00:00:00 2001 From: Adam Kudrna Date: Mon, 2 Sep 2024 22:58:41 +0200 Subject: [PATCH] Inherit link color in components using the Feedback color collection (#492) --- src/components/Alert/Alert.module.scss | 7 ++- src/components/Alert/README.md | 15 ++++- src/components/Card/Card.module.scss | 11 ++-- src/components/Card/README.md | 22 +++++++ src/components/TextLink/README.md | 13 +++- src/components/TextLink/_theme.scss | 6 +- src/styles/elements/_links.scss | 8 ++- src/styles/theme/_links.scss | 6 +- src/styles/tools/_collections.scss | 84 ++++++++++++++++++++++++-- 9 files changed, 147 insertions(+), 25 deletions(-) diff --git a/src/components/Alert/Alert.module.scss b/src/components/Alert/Alert.module.scss index cd8c2b72..658fe9c5 100644 --- a/src/components/Alert/Alert.module.scss +++ b/src/components/Alert/Alert.module.scss @@ -46,9 +46,11 @@ line-height: settings.$line-height; } - .message a, - .message strong { + .message :is(a, strong) { font-weight: theme.$emphasis-font-weight; + } + + .message strong { color: var(--rui-local-foreground-color); } @@ -73,6 +75,7 @@ $variant-name: "color", $variant-value: $color, $properties: settings.$themeable-properties, + $inherit-link-color: true, ); } } diff --git a/src/components/Alert/README.md b/src/components/Alert/README.md index befc886e..292bfd4d 100644 --- a/src/components/Alert/README.md +++ b/src/components/Alert/README.md @@ -41,6 +41,8 @@ Success alerts confirm that an operation has been processed successfully. ```docoff-react-preview Success: Settings have been successfully saved. + {' '} + ``` @@ -53,7 +55,7 @@ suggest an action to resolve the problem. Warning: Your credit card is going to expire soon. {' '} - Update my payment options + ``` @@ -68,7 +70,7 @@ problem. Error: Cannot connect to the server. Is your internet connection working fine? {' '} - Try again + ``` @@ -80,6 +82,8 @@ This kind of alert can be used to display helpful information. Help: You should choose a password you don't use anywhere else. + {' '} + ``` @@ -90,6 +94,8 @@ Another common, informative alert. ```docoff-react-preview Info: This feature depends on user's OS preferences. + {' '} + ``` @@ -100,6 +106,8 @@ Neutral informative alert. ```docoff-react-preview Note: This feature may not be available in all regions. + {' '} + ``` @@ -111,6 +119,8 @@ Light alert variant. Light alert: Stands out on dark backgrounds. + {' '} + ``` @@ -122,6 +132,7 @@ Dark alert variant. ```docoff-react-preview Dark alert: Stands out on light backgrounds. + ``` diff --git a/src/components/Card/Card.module.scss b/src/components/Card/Card.module.scss index 03befec5..92032d79 100644 --- a/src/components/Card/Card.module.scss +++ b/src/components/Card/Card.module.scss @@ -34,18 +34,19 @@ box-shadow: theme.$raised-box-shadow; } + .isRootDisabled { + background-color: theme.$disabled-background-color; + opacity: theme.$disabled-opacity; + } + @each $color in settings.$colors { @include collections.generate-class( $prefix: "rui-", $component-name: "Card", $variant-name: "color", $variant-value: $color, + $inherit-link-color: true, $properties: settings.$themeable-properties, ); } - - .isRootDisabled { - background-color: theme.$disabled-background-color; - opacity: theme.$disabled-opacity; - } } diff --git a/src/components/Card/README.md b/src/components/Card/README.md index 1604f519..42b2d3a1 100644 --- a/src/components/Card/README.md +++ b/src/components/Card/README.md @@ -154,6 +154,8 @@ To cover all possible needs of your project, Card is available in colors from Hello! I'm success variant of card. + {' '} +