Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/ten-otters-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@patternfly/elements": minor
---

Added dark mode support for <pf-select>, improving color contrast and accessibility.

4 changes: 2 additions & 2 deletions elements/pf-search-input/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
const searchInput = document.getElementById('search-input');

searchInput.addEventListener('change', (event) => {
/* eslint-disable no-console */
console.log('Selected:', event.target.value);
/* eslint-disable no-console */
});
</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
const searchInput = document.getElementById('search-input');

searchInput.addEventListener('change', (event) => {
/* eslint-disable no-console */
console.log('Selected:', event.target.value);
/* eslint-disable no-console */
});

const form = document.querySelector('form.container');
form.addEventListener('submit', (event) =>{
event.preventDefault();
/* eslint-disable no-console */
console.log("Value:", form.elements.search?.value);
/* eslint-disable no-console */
})
</script>

Expand Down
36 changes: 36 additions & 0 deletions elements/pf-select/pf-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -534,3 +534,39 @@ pf-badge {
background-color: var(--pf-c-divider--after--BackgroundColor);
flex: 1 0 100%;
}


@media (prefers-color-scheme: dark) {
:host {
color: var(--pf-global--Color--light-100, #f0f0f0);
}

#toggle {
background-color: var(--pf-global--BackgroundColor--dark-100, #151515) !important;
border-color: var(--pf-global--BorderColor--dark-200, #3c3f42);
}

#listbox-container {
background-color: var(--pf-global--BackgroundColor--dark-100, #151515) !important;
border-color: var(--pf-global--BorderColor--dark-200, #3c3f42);
}

#listbox slot.disabled {
background-color: var(--pf-global--BackgroundColor--dark-200, #212427) !important;
color: var(--pf-global--Color--light-200, #d2d2d2) !important;
}

#toggle-button,
#toggle-input {
color: var(--pf-global--Color--light-100, #f0f0f0);
}

#listbox {
color: var(--pf-global--Color--light-100, #f0f0f0);
}

#outer.disabled {
color: var(--pf-global--disabled-color--200, #6a6e73) !important;
background-color: var(--pf-global--BackgroundColor--dark-200, #212427) !important;
}
}
Loading