Skip to content

Commit dee9984

Browse files
[PLAY-1789] Dark Mode Select (#4128)
**What does this PR do?** A clear and concise description with your runway ticket url. This PR audits the Select component for proper use of dark mode colors. 1. Change all lables to use $text_dk_light 2. Select Inline us updated to have a more visible hover color 3. Error state is using $error_dark for border-color [Story](https://runway.powerhrg.com/backlog_items/PLAY-1789) **Screenshots:** Screenshots to visualize your addition/change <img width="588" alt="Screenshot 2025-01-15 at 8 33 22 AM" src="https://github.com/user-attachments/assets/a4dcc56d-b7c3-4bba-a9b9-8fb6f22b85d2" /> <img width="758" alt="Screenshot 2025-01-15 at 8 39 14 AM" src="https://github.com/user-attachments/assets/2419831c-72ea-4bc9-83ad-243390f92ea5" /> **How to test?** Steps to confirm the desired behavior: 1. Go to [https://pr4128.playbook.beta.gm.powerapp.cloud/kits/select/rails](https://pr4128.playbook.beta.gm.powerapp.cloud/kits/select/rails) 4. Turn on "Dark Mode" and go to the Select Kit 5. Scroll down to 'Select Default' 6. Compare caption text color to prod 7. Scroll down to 'Select w/Error' 8. Observe color of border and error message. Not that different from prod. 9. Scroll down to 'Select Inline' 10. Hover over to see color change #### Checklist: - [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new kit`, `deprecated`, or `breaking`. See [Changelog & Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels) for details. - [x] **DEPLOY** I have added the `milano` label to show I'm ready for a review. - [ ] **TESTS** I have added test coverage to my code.
1 parent a474767 commit dee9984

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Diff for: playbook/app/pb_kits/playbook/pb_select/_select.scss

+3-5
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,8 @@
209209
}
210210
.pb_select_kit_wrapper {
211211
&.error {
212-
.pb_select_kit_wrapper {
213-
> select:first-child {
214-
border-color: $error_dark;
215-
}
212+
> select {
213+
border-color: $error_dark;
216214
}
217215
}
218216
}
@@ -228,7 +226,7 @@
228226
&:hover {
229227
select {
230228
color: $white !important;
231-
background: rgba(0,130,255,0.1);
229+
background: $focus_input_dark;
232230
}
233231
svg {
234232
color: $primary !important;

Diff for: playbook/app/pb_kits/playbook/pb_select/_select.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ const Select = ({
127127
className="pb_select_kit_label"
128128
htmlFor={name}
129129
>
130-
<Caption text={label} />
130+
<Caption
131+
dark={props.dark}
132+
text={label}
133+
/>
131134
</label>
132135
}
133136
<label
@@ -146,6 +149,7 @@ const Select = ({
146149
}
147150
{error &&
148151
<Body
152+
dark={props.dark}
149153
status="negative"
150154
text={error}
151155
/>

Diff for: playbook/app/pb_kits/playbook/pb_select/select.html.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**combined_html_options) do %>
66
<% if object.label %>
77
<label class="pb_select_kit_label" for="<%= object.name %>">
8-
<%= pb_rails("caption", props: { text: object.label }) %>
8+
<%= pb_rails("caption", props: { text: object.label, dark: object.dark }) %>
99
</label>
1010
<% end %>
1111
<label class="<%= object.select_wrapper_class %>" for="<%= object.name %>">
@@ -23,7 +23,7 @@
2323
object.all_attributes
2424
)
2525
%>
26-
<%= pb_rails("body", props: { status: "negative", text: object.error }) %>
26+
<%= pb_rails("body", props: { status: "negative", text: object.error, dark: object.dark }) %>
2727
<% end %>
2828
<% if object.multiple != true %>
2929
<%= pb_rails("icon", props: { custom_icon: Playbook::Engine::root.join(angle_down_path), fixed_width: true, classname: "pb_select_kit_caret"}) %>

0 commit comments

Comments
 (0)