Skip to content

Commit

Permalink
Removed high contrast handling in Toaster fixes ibm-js#158
Browse files Browse the repository at this point in the history
    - removed .dj_a11y in Toaster css
    - changed the documentation
    - remove icon container in template
  • Loading branch information
Youcef Mammar authored and cjolif committed Dec 19, 2014
1 parent 0e4e7c0 commit c08a979
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 55 deletions.
3 changes: 1 addition & 2 deletions Toaster/ToasterMessage.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template class="{{ messageTypeClass }}" touch-action="none">
<button type="button" class="d-toaster-dismiss" attach-point="_dismissButton"></button>
<span class="d-toaster-icon"></span>
<span class="d-toaster-message-content">
{{ message }}
</span>
</template>
</template>
25 changes: 2 additions & 23 deletions Toaster/themes/bootstrap/Toaster.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,56 +131,35 @@ button.d-toaster-dismiss {
margin: .5em;
border: 1px transparent solid;
}
.dj_a11y .d-toaster-message {
border: .2em black solid;
}
.d-toaster-dismiss {
position: relative;
top: -5px;
right: -21px;
}
.d-toaster-message {
-webkit-touch-callout: none;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.dj_a11y .d-toaster-message .d-toaster-icon::before {
font-family: "webdings";
font-size: 2em;
margin-right: 1em;
line-height: .5em;
-moz-user-select: none;
}
.d-toaster-type-info {
background: #d9edf7;
border-color: #bce8f1;
color: #31708f;
}
.dj_a11y .d-toaster-type-info .d-toaster-icon::before {
content: "i";
}
.d-toaster-type-warning {
background-color: #fcf8e3;
border-color: #faebcc;
color: #8a6d3b;
}
.dj_a11y .d-toaster-type-warning .d-toaster-icon::before {
content: "U";
}
.d-toaster-type-success {
background-color: #dff0d8;
border-color: #d6e9c6;
color: #3c763d;
}
.dj_a11y .d-toaster-type-success .d-toaster-icon::before {
content: "a";
}
.d-toaster-type-error {
background-color: #f2dede;
border-color: #ebccd1;
color: #a94442;
}
.dj_a11y .d-toaster-type-error .d-toaster-icon::before {
content: "x";
}
32 changes: 3 additions & 29 deletions Toaster/themes/bootstrap/Toaster.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,59 +13,33 @@
border-radius:3px;
margin:.5em;
border: 1px transparent solid;
.dj_a11y & {
border: .2em black solid;
}

}
.d-toaster-dismiss {
position: relative;
top: -5px;
right: -21px;
}
.d-toaster-message {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

.dj_a11y & .d-toaster-icon::before {
font-family:"webdings";
font-size:2em;
margin-right:1em;
line-height:.5em;
}
-webkit-touch-callout: none;
.user-select(none);
}
.d-toaster-type-info {
background: @state-info-bg;
border-color: @state-info-border;
color: @state-info-text;
.dj_a11y & .d-toaster-icon::before {
content:"i";
}
}
.d-toaster-type-warning {
background-color: @state-warning-bg;
border-color: @state-warning-border;
color: @state-warning-text;
.dj_a11y & .d-toaster-icon::before {
content:"U";
}
}
.d-toaster-type-success {
background-color: @state-success-bg;
border-color: @state-success-border;
color: @state-success-text;
.dj_a11y & .d-toaster-icon::before {
content:"a";
}
}
.d-toaster-type-error {
background-color: @state-danger-bg;
border-color: @state-danger-border;
color: @state-danger-text;
.dj_a11y & .d-toaster-icon::before {
content:"x";
}
}
}
2 changes: 1 addition & 1 deletion docs/Toaster.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ m.dismiss("slide-out");
|type|status|comment|
|----|------|-------|
|Keyboard|none| The widget does not provide with any kind of interaction through the keyboard, besides |
|Visual Formatting|ok| The message type, an information which conveyed only through color, is translated to an icon when switching to eye contrast mode|
|Visual Formatting|partial| The message type information, which is conveyed only through color, disappears in high contrast mode. A few options are to be considered to solve this: the developer could use icons or explicitly indicate the type in the content of the message. |
|Screen Reader|ok|Tested on JAWS 15 and iOS 6 VoiceOver.|

### Globalization
Expand Down

0 comments on commit c08a979

Please sign in to comment.