summaryrefslogtreecommitdiffstats
path: root/app/common/styles/base/buttons.scss
blob: 9aeb725c670b3e4d1bd49c87af771738ea23d6bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
$btn-primary__bg: $color--blue-40;
$btn-primary__bg--hover: $color--blue-30;
$btn-primary__bg--disabled: $color--grey-40;
$btn-primary__txt: $color--grey-0;
$btn-primary__txt--disabled: $color--grey-60;

$btn-secondary__bg: $color--grey-0;
$btn-secondary__txt: $color--blue-40;
$btn-secondary__txt--hover: $color--blue-30;
$btn-secondary__txt--disabled: $color--grey-60;

$btn-tertiary__bg: transparent;
$btn-tertiary__txt: $color--blue-40;
$btn-tertiary__txt--hover: $color--blue-30;
$btn-tertiary__txt--disabled: $color--grey-60;

/***
Include .btn class in addition to the button type.
These styles provide structural and base properties
shared across all buttons. The additional button
type (.btn-primary, .btn-secondary) will provide color
properties
***/
button,
.btn,
[type='button'] {
  @include fontFamilyBold;
  @include fastTransition-all;
  border-style: solid;
  border-width: 2px;
  border-color: transparent;
  font-size: 1em;
  text-transform: none;
  border-radius: 0;
  padding: .5em 1em;
  line-height: 1;
  display: inline-block;
  cursor: pointer;
  &[disabled],
  &.disabled {
    opacity: 1;
    cursor: default;
  }
  &.full-width {
    width: 100%;
  }
  .icon,
  i {
    //button symbol
    font-style: normal;
    font-weight: normal;
    text-transform: none;
    display: inline-block;
    margin-right: 0.3em;
    vertical-align: bottom;
  }
  img {
    width: 1.5em;
    height: 1.5em;
    display: inline-block;
    margin-right: 0.5em;
  }
  svg {
    height: 1.2em;
    width: auto;
  }
}

/***
Use for the primary use-case/s that is non-destructive.
e.g. directing to a new page, a call to action
***/
.btn-primary {
  background-color: $btn-primary__bg;
  border-color: $btn-primary__bg;
  color: $btn-primary__txt;
  &:hover {
    background-color: $btn-primary__bg--hover;
    border-color: $btn-primary__bg--hover;
  }
  &[disabled],
  &.disabled {
    background: $btn-primary__bg--disabled;
    border-color: $btn-primary__bg--disabled;
    color: $btn-primary__txt--disabled;
      .icon {
        fill: $btn-primary__txt--disabled;
      }
  }
  .icon {
    fill: $btn-primary__txt;
  }
}

/***
Secondary buttons are actions that fall secondary or
of less priority to primary buttons.
These usually come coupled with a primary.
***/
.btn-secondary {
  background-color: $btn-secondary__bg;
  border-color: $btn-secondary__txt;
  color: $btn-secondary__txt;
  &:hover {
    background-color: $btn-secondary__bg;
    border-color: $btn-secondary__txt--hover;
    color: $btn-secondary__txt--hover;
    .icon {
      fill: $btn-secondary__txt--hover;
    }
  }
  &[disabled],
  &.disabled {
    background-color: $btn-secondary__bg;
    border-color: $btn-secondary__txt--disabled;
    color: $btn-secondary__txt--disabled;
    .icon {
      fill: $btn-secondary__txt--disabled;
    }
  }
  .icon {
    fill: $btn-secondary__txt;
  }
}

/***
Tertiary text buttons are used to identify less pressing or
optional actions given on a page.
***/
.btn-tertiary {
  background-color: $btn-tertiary__bg;
  border-color: $btn-tertiary__bg;
  color: $btn-tertiary__txt;
  &:hover {
    color: $btn-tertiary__txt--hover;
    .icon {
      fill: $btn-tertiary__txt--hover;
    }
  }
  &[disabled],
  &.disabled {
    color: $btn-tertiary__txt--disabled;
    .icon {
      fill: $btn-tertiary__txt--disabled;
    }
  }
  .icon {
    fill: $btn-tertiary__txt;
  }
}
OpenPOWER on IntegriCloud