blob: 1e2b799cd8e22273485012237855573976fc17fa [file] [log] [blame]
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -05001$btn-primary__bg: $base-01--03;
2$btn-primary__bg--hover: $base-01--04;
3$btn-primary__bg--disabled: $base-02--04;
4$btn-primary__txt: $base-02--08;
5$btn-primary__txt--disabled: $base-02--03;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -05006
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -05007$btn-secondary__bg: $base-02--08;
8$btn-secondary__txt: $base-01--03;
9$btn-secondary__txt--hover: $base-01--04;
10$btn-secondary__txt--disabled: $base-02--03;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050011
12$btn-tertiary__bg: transparent;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050013$btn-tertiary__txt: $base-01--03;
14$btn-tertiary__txt--hover: $base-01--04;
15$btn-tertiary__txt--disabled: $base-02--03;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050016
17/***
18Include .btn class in addition to the button type.
19These styles provide structural and base properties
20shared across all buttons. The additional button
21type (.btn-primary, .btn-secondary) will provide color
22properties
23***/
24button,
25.btn,
26[type='button'] {
Michael Davis51946552017-05-01 10:30:38 -050027 @include fontFamilyBold;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050028 @include fastTransition-all;
29 border-style: solid;
30 border-width: 2px;
31 border-color: transparent;
32 font-size: 1em;
Michael Davis19475752017-02-23 18:30:23 -060033 text-transform: none;
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -050034 border-radius: 0;
35 padding: .5em 1em;
36 line-height: 1;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050037 display: inline-block;
38 cursor: pointer;
39 &[disabled],
Iftekharul Islam8947e702017-07-27 10:28:07 -050040 &.disabled {
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050041 opacity: 1;
42 cursor: default;
Michael Davis19475752017-02-23 18:30:23 -060043 }
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050044 &.full-width {
45 width: 100%;
Michael Davis0f03ad12017-02-27 16:54:18 -060046 }
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050047 .icon,
beccabroek44da4712019-03-20 13:24:23 -050048 i {
49 //button symbol
Michael Davisc5626182017-03-10 15:48:05 -060050 font-style: normal;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050051 font-weight: normal;
Michael Davisc5626182017-03-10 15:48:05 -060052 text-transform: none;
Michael Davisc5626182017-03-10 15:48:05 -060053 display: inline-block;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050054 margin-right: 0.3em;
55 vertical-align: bottom;
Yoshie Muranakafa562732019-07-17 11:23:15 -050056 margin-left: -0.5em;
Michael Davisc5626182017-03-10 15:48:05 -060057 }
beccabroek44da4712019-03-20 13:24:23 -050058 img {
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -050059 width: 1.5em;
60 height: 1.5em;
Michael Davisc5626182017-03-10 15:48:05 -060061 display: inline-block;
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050062 margin-right: 0.5em;
Michael Davisc5626182017-03-10 15:48:05 -060063 }
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050064 svg {
65 height: 1.2em;
66 width: auto;
beccabroek309b5da2018-11-07 12:22:31 -060067 max-width: 100%;
Michael Davisc5626182017-03-10 15:48:05 -060068 }
miramurali235e8785d2019-06-10 15:09:27 -050069
70 // Override for specific icons
71 .icon-add {
72 margin-right: 0;
73 }
Michael Davis19475752017-02-23 18:30:23 -060074}
Michael Davis51946552017-05-01 10:30:38 -050075
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050076/***
77Use for the primary use-case/s that is non-destructive.
78e.g. directing to a new page, a call to action
79***/
80.btn-primary {
81 background-color: $btn-primary__bg;
82 border-color: $btn-primary__bg;
83 color: $btn-primary__txt;
Michael Davis51946552017-05-01 10:30:38 -050084 &:hover {
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050085 background-color: $btn-primary__bg--hover;
86 border-color: $btn-primary__bg--hover;
Michael Davis51946552017-05-01 10:30:38 -050087 }
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050088 &[disabled],
89 &.disabled {
90 background: $btn-primary__bg--disabled;
91 border-color: $btn-primary__bg--disabled;
92 color: $btn-primary__txt--disabled;
93 .icon {
94 fill: $btn-primary__txt--disabled;
95 }
Michael Davis51946552017-05-01 10:30:38 -050096 }
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -050097 .icon {
98 fill: $btn-primary__txt;
Michael Davis51946552017-05-01 10:30:38 -050099 }
beccabroek44da4712019-03-20 13:24:23 -0500100}
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -0500101
102/***
103Secondary buttons are actions that fall secondary or
104of less priority to primary buttons.
105These usually come coupled with a primary.
106***/
107.btn-secondary {
108 background-color: $btn-secondary__bg;
109 border-color: $btn-secondary__txt;
110 color: $btn-secondary__txt;
111 &:hover {
112 background-color: $btn-secondary__bg;
113 border-color: $btn-secondary__txt--hover;
114 color: $btn-secondary__txt--hover;
115 .icon {
116 fill: $btn-secondary__txt--hover;
117 }
118 }
119 &[disabled],
120 &.disabled {
121 background-color: $btn-secondary__bg;
122 border-color: $btn-secondary__txt--disabled;
123 color: $btn-secondary__txt--disabled;
124 .icon {
125 fill: $btn-secondary__txt--disabled;
126 }
127 }
128 .icon {
129 fill: $btn-secondary__txt;
130 }
131}
132
133/***
134Tertiary text buttons are used to identify less pressing or
135optional actions given on a page.
136***/
137.btn-tertiary {
138 background-color: $btn-tertiary__bg;
139 border-color: $btn-tertiary__bg;
140 color: $btn-tertiary__txt;
141 &:hover {
142 color: $btn-tertiary__txt--hover;
143 .icon {
144 fill: $btn-tertiary__txt--hover;
145 }
146 }
147 &[disabled],
148 &.disabled {
149 color: $btn-tertiary__txt--disabled;
150 .icon {
151 fill: $btn-tertiary__txt--disabled;
152 }
153 }
154 .icon {
155 fill: $btn-tertiary__txt;
156 }
Yoshie Muranakafb79e542019-08-12 09:02:00 -0500157}
158
159.btn-password-toggle {
160 position: absolute;
161 right: 0;
162 margin-top: -34px;
163 height: 32px;
164 width: 52px;
165 padding-top: 6px;
166 padding-bottom: 6px;
167 padding-right: 0;
168 .icon {
169 margin-right: 0;
170 }
171 &.password-visible {
172 .icon {
173 fill: $btn-tertiary__txt--disabled;
174 }
175 }
176 &.password-hidden {
177 .icon {
178 // Adding tweaks to make sure the icons
179 // are in the same place when toggling show/hide
180 margin-right: 1px;
181 width: 20px;
182 }
183 }
Yoshie Muranakac86ce3c2019-06-05 12:30:30 -0500184}