Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add borderless variants to Button, IconButton and SelectTrigger #546

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions packages/radix-ui-themes/src/components/base-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@

/* soft / ghost */

.rt-BaseButton:where(.rt-variant-soft, .rt-variant-ghost) {
.rt-BaseButton:where(.rt-variant-soft, .rt-variant-ghost, .rt-variant-borderless) {
color: var(--accent-a11);

&:where(.rt-high-contrast) {
Expand Down Expand Up @@ -353,7 +353,7 @@
}
}

.rt-BaseButton:where(.rt-variant-ghost) {
.rt-BaseButton:where(.rt-variant-ghost, .rt-variant-borderless) {
@media (hover: hover) {
&:where(:hover) {
background-color: var(--accent-a3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { radiusPropDef } from '../props/radius.prop.js';
import type { PropDef } from '../props/prop-def.js';

const sizes = ['1', '2', '3', '4'] as const;
const variants = ['classic', 'solid', 'soft', 'surface', 'outline', 'ghost'] as const;
const variants = ['classic', 'solid', 'soft', 'surface', 'outline', 'borderless', 'ghost'] as const;

const baseButtonPropDefs = {
...asChildPropDef,
Expand Down
6 changes: 4 additions & 2 deletions packages/radix-ui-themes/src/components/select.css
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@
/* soft / ghost */

.rt-SelectTrigger:where(.rt-variant-soft),
.rt-SelectTrigger:where(.rt-variant-ghost) {
.rt-SelectTrigger:where(.rt-variant-ghost),
.rt-SelectTrigger:where(.rt-variant-borderless) {
color: var(--accent-12);

&:where([data-placeholder]) {
Expand Down Expand Up @@ -430,7 +431,8 @@
}
}

.rt-SelectTrigger:where(.rt-variant-ghost) {
.rt-SelectTrigger:where(.rt-variant-ghost),
.rt-SelectTrigger:where(.rt-variant-borderless) {
@media (hover: hover) {
&:where(:hover) {
background-color: var(--accent-a3);
Expand Down
2 changes: 1 addition & 1 deletion packages/radix-ui-themes/src/components/select.props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const selectRootPropDefs = {
size: PropDef<(typeof sizes)[number]>;
};

const triggerVariants = ['classic', 'surface', 'soft', 'ghost'] as const;
const triggerVariants = ['classic', 'surface', 'soft', 'borderless', 'ghost'] as const;

const selectTriggerPropDefs = {
variant: { type: 'enum', className: 'rt-variant', values: triggerVariants, default: 'surface' },
Expand Down