Skip to content

Commit dc2c137

Browse files
committed
fix: do not use font-weight: 500 for "simplistic" selects, those with no item descriptions
1 parent c133c93 commit dc2c137

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Diff for: plugins/plugin-codeflare/src/components/Ask.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,15 @@ export default class AskUI extends React.PureComponent<Props, State> {
300300
children: mkOptions(),
301301
}
302302

303+
// is every message the same as the title?
304+
const isSimplistic = ask.prompt.choices.every(
305+
(_) => _.name === stripAnsi(_.message).replace(" ◄ you selected this last time", "")
306+
)
307+
303308
return (
304309
<React.Fragment>
305310
<span id={titleId} hidden />
306-
{this.card(ask, <Select {...props} />)}
311+
{this.card(ask, <Select {...props} data-is-simplistic={isSimplistic || undefined} />)}
307312
</React.Fragment>
308313
)
309314
}

Diff for: plugins/plugin-codeflare/web/scss/components/Ask/_index.scss

+3-1
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ $max-width: 50rem;
5353
max-width: $max-width;
5454
}
5555

56-
.pf-c-select__menu-item-main {
56+
.pf-c-select__menu:not([data-is-simplistic]) .pf-c-select__menu-item-main {
5757
font-weight: 500;
58+
}
59+
.pf-c-select__menu-item-main {
5860
white-space: normal;
5961
}
6062
}

0 commit comments

Comments
 (0)