@@ -43,12 +43,18 @@ Renders a button element when given no redirection props, otherwise, renders <a/
4343 <NcButton v-if =" (name || icon) && !$slots.default"
4444 :title =" title"
4545 :aria-label =" icon ? name : undefined"
46+ type =" tertiary"
4647 v-bind =" linkAttributes"
4748 v-on =" $listeners" >
48- <slot name =" icon" >
49- <span v-if =" icon" :class =" icon" class =" icon" />
50- <span v-else >{{ name }}</span >
51- </slot >
49+ <template v-if =" $slots .icon || icon " #icon >
50+ <!-- @slot Slot for passing a material design icon. Precedes the icon and name prop. -->
51+ <slot name =" icon" >
52+ <span :class =" icon" class =" icon" />
53+ </slot >
54+ </template >
55+ <template v-else #default >
56+ {{ name }}
57+ </template >
5258 </NcButton >
5359 <NcActions v-if =" $slots.default"
5460 ref =" actions"
@@ -185,7 +191,12 @@ export default {
185191 */
186192 linkAttributes () {
187193 // If it's a router-link, we pass `to` and `exact`, if its an <a/> element, we pass `href`, otherwise we have a button
188- return this .to ? { to: this .to , exact: this .exact , ... this .$attrs } : (this .href ? { href: this .href , ... this .$attrs } : { type: ' tertiary' , ... this .$attrs })
194+ return this .to
195+ ? { to: this .to , exact: this .exact , ... this .$attrs }
196+ : (this .href
197+ ? { href: this .href , ... this .$attrs }
198+ : this .$attrs
199+ )
189200 },
190201 },
191202 methods: {
@@ -276,7 +287,6 @@ export default {
276287 padding : 0 ;
277288
278289 & :last-child {
279- font-weight : bold ;
280290 min-width : 0 ;
281291
282292 // Don't show breadcrumb separator for last crumb
@@ -285,6 +295,37 @@ export default {
285295 }
286296 }
287297
298+ // Necessary to hide hidden crumbs
299+ & --hidden {
300+ display : none ;
301+ }
302+ & __separator {
303+ padding : 0 ;
304+ color : var (--color-text-maxcontrast );
305+ }
306+ // Necessary for indicating hovering for drag and drop
307+ & #{&} --hovered :deep (.button-vue ) {
308+ background-color : var (--color-background-dark );
309+ color : var (--color-main-text );
310+ }
311+ // Adjust button style
312+ & :not (:last-child ) :deep() .button-vue {
313+ color : var (--color-text-maxcontrast );
314+
315+ & :hover ,
316+ & :focus {
317+ background-color : var (--color-background-dark );
318+ color : var (--color-main-text );
319+ }
320+
321+ & __text {
322+ font-weight : normal ;
323+ }
324+ }
325+ :deep(.button-vue__text ) {
326+ margin : 0 ;
327+ }
328+
288329 // Adjust action item appearance for crumbs with actions
289330 // to match other crumbs
290331 & :not (.dropdown ) :deep(.action-item ) {
0 commit comments