Debian Codegraph @

skins/Vector/resources/skins.vector.styles/components/Button.less

raw
1 .cdx-button:not( .cdx-button--icon-only ) .vector-icon {
2 // Add spacing between icon and text
3 margin-right: @spacing-35;
4 }
5
6 .cdx-button {
7 // Needed to horizontaly center icon buttons (floating TOC button, watchstar button)
8 // Can be seen on small viewports due to the fact that we arent using `.cdx-button--size-large`
9 justify-content: center;
10 }
11
12 // These rules are scoped to Vector headers due to T342190 as otherwise where buttons are used alongside
13 // input elements the display can look "off".
14 // Any other instances outside headers should be targeted directly by a rule on the element itself.
15 #p-lang-btn-label.cdx-button--icon-only,
16 #vector-page-titlebar-toc-label,
17 .vector-header .cdx-button.cdx-button--icon-only {
18 // Increase padding on small viewports
19 // FIXME: T338163 Replace with Codex solution i.e. `.cdx-button--size-large`
20 @media ( max-width: @max-width-breakpoint-tablet ) {
21 @min-size-interactive-touch: 44px;
22 min-height: @min-size-interactive-touch;
23 // FIXME: This results in inconsistencies with icon-only buttons with a dropdown arrow
24 // (i.e. user dropdown toggle), because those buttons should have a larger width than
25 // @min-size-interactive-touch. Instead of min-width we should be increasing the horizontal padding
26 min-width: @min-size-interactive-touch;
27 }
28 }
29
30 // Hide text in icon only buttons
31 .cdx-button.cdx-button--icon-only {
32 span + span {
33 .mixin-screen-reader-text();
34 }
35 }
36
37 .vector-button-flush-left {
38 @media ( min-width: @min-width-breakpoint-desktop ) {
39 .cdx-mixin-button-layout-flush( 'start', true );
40 }
41
42 @media ( max-width: @max-width-breakpoint-tablet ) {
43 .cdx-mixin-button-layout-flush( 'start', true, 'large' );
44 }
45 }
46
47 .vector-button-flush-right {
48 @media ( min-width: @min-width-breakpoint-desktop ) {
49 .cdx-mixin-button-layout-flush( 'end', true );
50 }
51
52 @media ( max-width: @max-width-breakpoint-tablet ) {
53 .cdx-mixin-button-layout-flush( 'end', true, 'large' );
54 }
55 }
56
57 // Handle button styles in checkbox hack, copied from Codex
58 // FIXME: Remove these styles when Codex supports the checkbox hack in T333394
59 input:hover + .cdx-button:not( .cdx-button--action-progressive ) + .cdx-button:not( .vector-page-titlebar-toc ) {
60 background-color: @background-color-button-quiet--hover;
61 }
62
63 input:active + .cdx-button:not( .cdx-button--action-progressive ) + .cdx-button:not( .vector-page-titlebar-toc ) {
64 background-color: @background-color-button-quiet--active;
65 color: @color-emphasized;
66 border-color: @border-color-interactive;
67 }
68
69 input:focus:not( :active ) + .cdx-button:not( .cdx-button--action-progressive ) {
70 border-color: @border-color-progressive--focus;
71 box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus;
72 }
73
74 input:hover + .cdx-button.cdx-button--action-progressive {
75 background-color: @background-color-progressive-subtle;
76 color: @color-progressive--hover;
77 }
78
79 input:active + .cdx-button.cdx-button--action-progressive {
80 background-color: @background-color-progressive--active;
81 color: @color-inverted;
82 border-color: @border-color-progressive--active;
83 }
84
85 input:focus:not( :active ) + .cdx-button.cdx-button--action-progressive {
86 border-color: @border-color-progressive--focus;
87 box-shadow: @box-shadow-inset-small @box-shadow-color-progressive--focus @box-shadow-inset-medium @box-shadow-color-inverted;
88 }