6 examples of 'material ui button color' in JavaScript

Every line of 'material ui button color' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
19get color() {
20 return ColorButton.getColor(this.handle);
21}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

37get color(): ColorTheme {
38 return this._color;
39}
6function Button({
7 size = 1,
8 disabled,
9 danger,
10 variant = 'primary',
11 css,
12 ...props
13}) {
14 const isPrimary = variant === 'primary'
15 const bgColor = danger ? theme.colors.danger : theme.colors.primary
16
17 const bg = isPrimary ? bgColor : transparentize(0.88, bgColor)
18 const color = isPrimary ? theme.colors.white : theme.colors.primary
19
20 return (
21 <>
22 <button type="button" disabled={disabled} style={css} {...props} />
23 <style jsx>{`
24 button {
25 background: ${bg};
26 border: none;
27 border-radius: 6px;
28 color: ${color};
29 cursor: pointer;
30 font-size: ${`${size}em`};
31 padding: ${`${0.5 * size}em ${size}em`};
32 outline: none;
33 transition: background 0.3s ease, color 0.3s ease;
34 }
35 button:hover {
36 background: ${darken(0.1, bg)};
37 color: ${darken(0.05, color)};
38 }
39 button:disabled {
40 cursor: default;
41 opacity: 0.5;
42 }
43 `}</style>
44 </>
45 )
46}
283private getActionButtonColor() {
284 // コントラスト比4.5(chromeの推奨する最低ライン)の色
285 const contrastLimitColor = '#697b8c';
286
287 const actionButton = document.querySelector(
288 '.ProfileTweet-actionButton'
289 ) as HTMLElement;
290 if (!(actionButton && actionButton.style)) {
291 return contrastLimitColor;
292 }
293
294 const buttonColor = window.getComputedStyle(actionButton).color;
295 if (buttonColor && buttonColor.length > 0) {
296 return buttonColor;
297 }
298 return contrastLimitColor;
299}
76@Input() set color(value: string) {
77 if (value !== 'gray') {
78 this._colorTemp = value;
79 this.setColor(value);
80 }
81}
97public set color(value: Color | undefined) {
98 this._color = value;
99 this.titleLabel.textColor = value || this.tintColor;
100}

Related snippets