Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5d0a8c6
feat: added native select styling
mfranzke Jun 15, 2025
518fc22
Merge branch 'main' into feat-multi-select-native-select-styling-new
mfranzke Jul 27, 2025
4a05549
auto update snapshots (#4625)
github-actions[bot] Jul 27, 2025
9148e3d
Apply suggestions from code review
mfranzke Jul 27, 2025
470cd00
Apply suggestions from code review
mfranzke Jul 27, 2025
bfc69f3
auto update snapshots (#4626)
github-actions[bot] Jul 27, 2025
5afda6f
Update DBSelect-default-1.txt
mfranzke Jul 27, 2025
3e28771
Merge branch 'main' into feat-multi-select-native-select-styling-new
mfranzke Aug 3, 2025
c09b935
Merge branch 'main' into feat-multi-select-native-select-styling-new
mfranzke Aug 3, 2025
9a01db3
fix: preview branches not being deployed anymore
mfranzke Aug 4, 2025
53f058e
Update default.yml
mfranzke Aug 4, 2025
b75f125
Merge branch 'main' into feat-multi-select-native-select-styling-new
mfranzke Aug 4, 2025
4faeb87
Merge branch 'main' into feat-multi-select-native-select-styling-new
mfranzke Aug 5, 2025
1f6e87a
refactor: merge from main
mfranzke Nov 23, 2025
8a86cdf
Change flexbox direction for option elements
mfranzke Nov 24, 2025
119e374
auto update snapshots (#5509)
github-actions[bot] Nov 24, 2025
f84141e
Merge branch 'main' into feat-multi-select-native-select-styling-new
mfranzke Nov 24, 2025
53bce15
Merge branch 'main' into feat-multi-select-native-select-styling-new
mfranzke Dec 5, 2025
0b9982f
feat: adapt CustomSelect styles to native select ::picker pseudo-elem…
Copilot Dec 5, 2025
e8a3cf5
Update default.spec.ts
mfranzke Dec 6, 2025
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions packages/components/src/components/select/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@use "@db-ux/core-foundations/build/styles/colors";
@use "@db-ux/core-foundations/build/styles/icons";
@use "@db-ux/core-foundations/build/styles/fonts";
@use "@db-ux/core-foundations/build/styles/helpers";
@use "../../styles/internal/form-components";
@use "../../styles/internal/component";
@use "../../styles/internal/select-components";
Expand Down Expand Up @@ -49,4 +50,87 @@
display: none;
}
}

// enable customized styling
@supports (appearance: base-select) {
select,
/* stylelint-disable-next-line selector-pseudo-element-no-unknown */
::picker(select) {
/* stylelint-disable-next-line declaration-property-value-no-unknown */
appearance: base-select;
}

/* stylelint-disable-next-line selector-pseudo-element-no-unknown */
&::picker-icon {
display: none;
}

/* stylelint-disable-next-line selector-pseudo-element-no-unknown */
:is(::picker(select)) {
@extend %default-card;

// Adapted from .db-custom-select-dropdown
position: absolute;
z-index: 32;
box-shadow: variables.$db-elevation-md;
min-inline-size: variables.$db-sizing-xl;
max-inline-size: calc(
100vw - 2 * #{variables.$db-spacing-fixed-sm}
);

// Adapted from .db-card
background-color: colors.$db-adaptive-bg-basic-level-1-default;
padding: variables.$db-spacing-fixed-sm;

// Adapted from .db-custom-select-list
overflow-block: auto;

/* (option height + padding) * 5.5 items (showing partial item to indicate more content) + list padding */
max-block-size: calc(
5.5 *
(
(
#{form-components.$font-size-height} - 2 *
#{variables.$db-border-width-3xs}
) +
2 * #{variables.$db-spacing-fixed-sm}
) +
(#{variables.$db-spacing-fixed-sm} * 2)
);
}

option {
// Adapted from .db-custom-select-list-item
position: relative;
padding: variables.$db-spacing-fixed-sm;
background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
border-radius: variables.$db-border-radius-xs;
box-sizing: border-box;
justify-content: space-between;

// change order of the included text and pseudo-element within this flexbox item, to make sure the icon is always on the right
flex-direction: row-reverse;

&:checked {
font-weight: 700;
}

// Hover states adapted from .db-custom-select-list-item
&:not(:checked) {
@include helpers.hover {
background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
}

@include helpers.active {
background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
}
}

/* stylelint-disable-next-line selector-pseudo-element-no-unknown */
:is(&::checkmark) {
@extend %icon;
@include icons.icon-content("check");
}
}
}
}
4 changes: 2 additions & 2 deletions showcases/patternhub/tests/default.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ for (const group of Components) {
`docs`,
`.${group.path}/${component.name}/docs/Angular`,
async (page) => {
const firstH2 = page.locator('h2').first();
await expect(firstH2).toBeVisible();
const firstHeading = page.locator('h1, h2').first();
await expect(firstHeading).toBeVisible();
}
);
});
Expand Down
Loading