Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Safari bug: Safari ignores :enabled pseudo class, preventing button active and hover states from taking effect. #10369

Merged
merged 1 commit into from
Feb 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions ui_framework/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* 1. Setting to inline-block guarantees the same height when applied to both
* button elements and anchor tags.
* 2. Disable for Angular.
* 3. Safari won't respect :enabled:active on links.
*/
.kuiButton {
display: inline-block; /* 1 */
Expand All @@ -20,7 +21,7 @@
pointer-events: none; /* 2 */
}

&:active:enabled {
&:active { /* 3 */
transform: translateY(1px);
}

Expand All @@ -43,6 +44,7 @@

/**
* 1. Override Bootstrap.
* 2. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--basic {
color: #5a5a5a;
Expand All @@ -53,8 +55,8 @@
color: #5a5a5a !important; /* 1 */
}

&:hover:enabled,
&:active:enabled {
&:hover, /* 2 */
&:active { /* 2 */
color: #ffffff !important; /* 1 */
background-color: #9B9B9B;
}
Expand All @@ -66,13 +68,14 @@

/**
* 1. Override Bootstrap.
* 2. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--primary {
color: #FFFFFF;
background-color: #6EADC1;

&:hover:enabled,
&:active:enabled {
&:hover, /* 2 */
&:active { /* 2 */
color: #FFFFFF !important; /* 1 */
background-color: #006E8A;
}
Expand All @@ -88,13 +91,14 @@

/**
* 1. Override Bootstrap.
* 2. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--danger {
color: #FFFFFF;
background-color: #D76051;

&:hover:enabled,
&:active:enabled {
&:hover, /* 2 */
&:active { /* 2 */
color: #FFFFFF !important; /* 1 */
background-color: #A52E1F;
}
Expand All @@ -112,13 +116,14 @@
/**
* 1. Override Bootstrap.
* 2. Override either Bootstrap or Timelion styles.
* 3. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--hollow {
color: $linkColor !important; /* 2 */
background-color: transparent;

&:hover:enabled,
&:active:enabled {
&:hover, /* 3 */
&:active { /* 3 */
color: $linkHoverColor !important; /* 1 */
text-decoration: underline;
}
Expand Down
20 changes: 15 additions & 5 deletions ui_framework/dist/ui_framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ body {
* 1. Setting to inline-block guarantees the same height when applied to both
* button elements and anchor tags.
* 2. Disable for Angular.
* 3. Safari won't respect :enabled:active on links.
*/
.kuiButton {
display: inline-block;
Expand All @@ -126,7 +127,8 @@ body {
cursor: default;
pointer-events: none;
/* 2 */ }
.kuiButton:active:enabled {
.kuiButton:active {
/* 3 */
-webkit-transform: translateY(1px);
transform: translateY(1px); }
.kuiButton:focus {
Expand All @@ -145,14 +147,16 @@ body {

/**
* 1. Override Bootstrap.
* 2. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--basic {
color: #5a5a5a;
background-color: #F2F2F2; }
.kuiButton--basic:focus {
color: #5a5a5a !important;
/* 1 */ }
.kuiButton--basic:hover:enabled, .kuiButton--basic:active:enabled {
.kuiButton--basic:hover, .kuiButton--basic:active {
/* 2 */
color: #ffffff !important;
/* 1 */
background-color: #9B9B9B; }
Expand All @@ -161,11 +165,13 @@ body {

/**
* 1. Override Bootstrap.
* 2. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--primary {
color: #FFFFFF;
background-color: #6EADC1; }
.kuiButton--primary:hover:enabled, .kuiButton--primary:active:enabled {
.kuiButton--primary:hover, .kuiButton--primary:active {
/* 2 */
color: #FFFFFF !important;
/* 1 */
background-color: #006E8A; }
Expand All @@ -177,11 +183,13 @@ body {

/**
* 1. Override Bootstrap.
* 2. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--danger {
color: #FFFFFF;
background-color: #D76051; }
.kuiButton--danger:hover:enabled, .kuiButton--danger:active:enabled {
.kuiButton--danger:hover, .kuiButton--danger:active {
/* 2 */
color: #FFFFFF !important;
/* 1 */
background-color: #A52E1F; }
Expand All @@ -200,12 +208,14 @@ body {
/**
* 1. Override Bootstrap.
* 2. Override either Bootstrap or Timelion styles.
* 3. Safari won't respect :enabled:hover/active on links.
*/
.kuiButton--hollow {
color: #3CAED2 !important;
/* 2 */
background-color: transparent; }
.kuiButton--hollow:hover:enabled, .kuiButton--hollow:active:enabled {
.kuiButton--hollow:hover, .kuiButton--hollow:active {
/* 3 */
color: #006E8A !important;
/* 1 */
text-decoration: underline; }
Expand Down