You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix incorrect button sizes introduced by RcButton changes (#17178)
* Fixing some of the more notable size discrepencies with RcButton
Fixes#16755
* Removed the change to the RcButton default size.
* An attempt at wrapping the RcButton with a link to prevent regression.
* Provided a convenience prop in RcButton to support links shaped like buttons
This is almost entirely based on @rak-phillip 's work at ab4abcf
* Reintroducing the role attribute
* Updated storybook
* Found an area where we had additional margin being adding in the sortable table bulk actions.
* Fixing a size issue I noticed with the notifcation button.
This was likely caused by missing changes we made to the rcbutton default size.
const tag =computed(() => (props.to?resolveComponent('RouterLink') :'button'));
56
+
const role =computed(() => (props.to?'link':'button'));
37
57
38
58
const activeVariantClassName =computed(() => {
39
59
if (props.variant==='multiAction'||props.multiAction) {
@@ -94,9 +114,11 @@ defineExpose({ focus });
94
114
</script>
95
115
96
116
<template>
97
-
<button
117
+
<component
118
+
:is="tag"
98
119
ref="RcFocusTarget"
99
-
role="button"
120
+
:role="role"
121
+
:to="to"
100
122
:class="{ ...buttonClass }"
101
123
>
102
124
<slot
@@ -124,15 +146,23 @@ defineExpose({ focus });
124
146
size="inherit"
125
147
/>
126
148
</slot>
127
-
</button>
149
+
</component>
128
150
</template>
129
151
130
152
<style lang="scss" scoped>
131
-
button {
153
+
.rc-button {
132
154
display: inline-flex;
133
155
align-items: center;
134
156
justify-content: center;
135
157
158
+
// Override global .btn > .icon:not(:only-child) { margin-right: 6px } from _button.scss.
159
+
// RcButton uses flex gap for spacing instead. The :not(:only-child) clause matches the global
160
+
// selector so we win on specificity regardless of stylesheet load order; :deep() is needed to
161
+
// target slotted content.
162
+
& > :deep(.icon:not(:only-child)) {
163
+
margin-right: 0;
164
+
}
165
+
136
166
// Much of the styling in here came from _button.scss. Because we're making changes from role to variant and we don't want to impact existing use cases we're pulling in some of these styles. We should in the long run deprecate that file.
0 commit comments