From f313cf978ceaa0d994c691c10d88a4015f272243 Mon Sep 17 00:00:00 2001 From: ls-dennis-marchand <76014778+ls-dennis-marchand@users.noreply.github.com> Date: Wed, 19 May 2021 10:07:26 -0700 Subject: [PATCH] Base label color on disabled prop (#139) * Base label color on disabled prop This commit alters the color of labels for both the Radio and Checkbox components if the disabled prop is sent down as true. The idea behind this is that the visual cue that indicates the component is disabled becomes more reliable when it is applied to the element as a whole. * Update CHANGELOG --- packages/flame/CHANGELOG.md | 6 +++ .../__snapshots__/Checkbox.test.tsx.snap | 40 +++++++++---------- packages/flame/src/Radio/Radio.tsx | 4 +- .../Radio/__snapshots__/Radio.test.tsx.snap | 34 ++++++++-------- 4 files changed, 46 insertions(+), 38 deletions(-) diff --git a/packages/flame/CHANGELOG.md b/packages/flame/CHANGELOG.md index 3b47b438..577ce1a3 100644 --- a/packages/flame/CHANGELOG.md +++ b/packages/flame/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Refer to the [CONTRIBUTING guide](https://github.com/lightspeed/flame/blob/master/.github/CONTRIBUTING.md) for more info. +## [Unreleased] + +### Changed + +- Base label color on disabled prop ([#139](https://github.com/lightspeed/flame/pull/139)) + ## 2.1.0-alpha.1 - 2021-03-10 ### Fixed diff --git a/packages/flame/src/Checkbox/__snapshots__/Checkbox.test.tsx.snap b/packages/flame/src/Checkbox/__snapshots__/Checkbox.test.tsx.snap index f36ab2b3..48aa08c5 100644 --- a/packages/flame/src/Checkbox/__snapshots__/Checkbox.test.tsx.snap +++ b/packages/flame/src/Checkbox/__snapshots__/Checkbox.test.tsx.snap @@ -3,8 +3,8 @@ exports[` Snapshots when all props and label/description with html should render correctly 1`] = ` .emotion-9 { margin: 0; - font-weight: 700; color: #0c0d0d; + font-weight: 700; font-size: 0.875rem; line-height: 1.125rem; font-weight: 700; @@ -151,8 +151,8 @@ exports[` Snapshots when all props and label/description with html s exports[` Snapshots when all props should render correctly 1`] = ` .emotion-9 { margin: 0; - font-weight: 700; color: #0c0d0d; + font-weight: 700; font-size: 0.875rem; line-height: 1.125rem; font-weight: 700; @@ -295,8 +295,8 @@ exports[` Snapshots when all props should render correctly 1`] = ` exports[` Snapshots when checked should render correctly 1`] = ` .emotion-9 { margin: 0; - font-weight: 700; color: #0c0d0d; + font-weight: 700; font-size: 0.875rem; line-height: 1.125rem; font-weight: 700; @@ -422,19 +422,6 @@ exports[` Snapshots when checked should render correctly 1`] = ` `; exports[` Snapshots when disabled should render correctly 1`] = ` -.emotion-9 { - margin: 0; - font-weight: 700; - color: #0c0d0d; - font-size: 0.875rem; - line-height: 1.125rem; - font-weight: 700; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; -} - .emotion-7 { position: relative; line-height: 1rem; @@ -507,12 +494,25 @@ exports[` Snapshots when disabled should render correctly 1`] = ` fill: #fff; } +.emotion-9 { + margin: 0; + color: #e1e4e5; + font-weight: 700; + font-size: 0.875rem; + line-height: 1.125rem; + font-weight: 700; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} +