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

Update: remove text-shadow + box-shadow when 'No Transparency' enabled (fixes #73) #113

Merged
merged 5 commits into from
Apr 16, 2024
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ It provides visual accessibility improvements.
* In order to support paragraph spacing, all body text needs to be wrapped in [paragraph tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p).
* Font size medium is the default font size (16px usually), large is 18pt, small is 9pt.
* Hide decorative images is contingent on alt text.
* No transparency removes `box-shadow` (where transparency is used), `text-shadow` and `opacity` styles.

### Theme considerations
* All colour transformations are applied by mathematical shifts. It is therefore important that the course start from AA colour contrast for the algorithms to be applicable.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "git",
"url": "https://github.com/cgkineo/adapt-visua11y.git"
},
"version": "2.8.2",
"version": "2.9.0",
"framework": ">=5.31.4",
"homepage": "https://github.com/cgkineo/adapt-visua11y",
"issues": "https://github.com/cgkineo/adapt-visua11y/issues/new",
Expand Down
15 changes: 13 additions & 2 deletions js/CSSRuleModifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@ import Color from './Color';
*/
export default [
[
// Remove box shadows
'box-shadow',
// Remove text shadows
'text-shadow',
null,
function () {
if (!this.noTransparency) return;
return 'none';
}
],
[
// Remove box shadows with transparency
'box-shadow',
null,
function (output) {
if (!this.noTransparency) return;
const zeroOffsetAndBlur = '0px 0px 0px';
if (output.includes(zeroOffsetAndBlur)) return;
return 'none';
}
],
[
// Increase opacity either way
'opacity',
Expand Down
1 change: 0 additions & 1 deletion less/buttons.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.nav__visua11y-btn {
.u-float-right;
.icon {
.icon-visua11y-accessibility;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "git",
"url": "https://github.com/cgkineo/adapt-visua11y.git"
},
"version": "2.8.2",
"version": "2.9.0",
"framework": ">=5.31.4",
"homepage": "https://github.com/cgkineo/adapt-visua11y",
"issues": "https://github.com/cgkineo/adapt-visua11y/issues/new",
Expand Down