sass-apca 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -2
  2. package/apca.scss +5 -5
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -61,7 +61,6 @@ These general levels are appropriate for use by themselves, without the need to
61
61
  - **L<sup>c</sup> 15** • The absolute minimum for any non-text that needs to be discernible and differentiable, and is no less than 6px in its smallest dimension. This may include disabled large buttons. Designers should treat anything below this level as invisible, as it will not be visible for many users. This minimum level should be avoided for any items important to the use, understanding, or interaction of the site.
62
62
 
63
63
  ## Roadmap
64
- - Polarity function for figuring out if light or dark text has a higher contrast on any given background
65
64
  - Compliance check for getting the current level of compliance of a given contrast ratio
66
65
 
67
66
 
@@ -71,4 +70,4 @@ These general levels are appropriate for use by themselves, without the need to
71
70
  Code published in this repository licensed under the [MIT license](https://github.com/gfellerph/sass-apca/blob/main/LICENSE).
72
71
 
73
72
  [^1]: APCA contrast calculator (https://www.myndex.com/APCA/)
74
- [^2]: Why APCA (https://git.apcacontrast.com/documentation/WhyAPCA#use-case-ranges)
73
+ [^2]: Why APCA (https://git.apcacontrast.com/documentation/WhyAPCA#use-case-ranges)
package/apca.scss CHANGED
@@ -30,9 +30,9 @@ $_greenMultiplier: 0.7151522;
30
30
  $_blueMultiplier: 0.072175;
31
31
 
32
32
  @function _luminance($color) {
33
- $red: color.red($color);
34
- $green: color.green($color);
35
- $blue: color.blue($color);
33
+ $red: color.channel($color, "red", $space: rgb);
34
+ $green: color.channel($color, "green", $space: rgb);
35
+ $blue: color.channel($color, "blue", $space: rgb);
36
36
 
37
37
  $redLuminance: math.pow(math.div($red, 255), $_Strc) * $_redMultiplier;
38
38
  $greenLuminance: math.pow(math.div($green, 255), $_Strc) * $_greenMultiplier;
@@ -69,7 +69,7 @@ $_blueMultiplier: 0.072175;
69
69
  * @param {color} $textColor Text color
70
70
  * @param {color} $backgroundColor Background color
71
71
  *
72
- * @return {number} A number between -108 and 107 representing the lightness contrast
72
+ * @return {number} A number between -108 and 107 representing the lightness contrast
73
73
  */
74
74
  @function contrast($textColor, $backgroundColor) {
75
75
  @if (meta.type-of($textColor) != 'color') {
@@ -113,7 +113,7 @@ $_blueMultiplier: 0.072175;
113
113
  @if (meta.type-of($backgroundColor) != 'color') {
114
114
  @error "Type Error: apca.recommend-text-color expects a color as third argument but received #{meta.type-of($darkColor)}. Please provide a valid color.";
115
115
  }
116
-
116
+
117
117
  $lightContrast: math.abs(contrast($lightColor, $backgroundColor));
118
118
  $darkContrast: math.abs(contrast($darkColor, $backgroundColor));
119
119
  $contrastColor: null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sass-apca",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Sass implementation of the [Accessible Perceptual Contrast Algorithm (APCA)](https://git.apcacontrast.com/) for the WCAG 3.0 specification.",
5
5
  "keywords": [
6
6
  "sass",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@semantic-release/changelog": "6.0.3",
31
31
  "@semantic-release/git": "10.0.1",
32
- "sass": "1.60.0",
33
- "semantic-release": "21.0.0"
32
+ "sass": "1.81.0",
33
+ "semantic-release": "24.2.0"
34
34
  }
35
35
  }