fix(curriculum) : change 'colour' to 'color' to use american spelling (#58218)

This commit is contained in:
Chamali Vishmani 2025-01-18 18:26:17 +05:30 committed by GitHub
parent 445dfff017
commit 6d808de3b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View File

@ -19,7 +19,7 @@ Fulfill the user stories below and get all the tests to pass to complete the lab
- `"The weather will be nice tomorrow."`
- `"Be cautious of your new neighbours."`
- `"You will find a new hobby soon."`
- `"It would be wise to avoid the colour red today."`
- `"It would be wise to avoid the color red today."`
2. You should select a random number between 1 and 5, inclusive, and assign it to the variable `randomNumber`.
@ -122,7 +122,7 @@ const fortune1 = "Your cat will look very cuddly today.";
const fortune2 = "The weather will be nice tomorrow.";
const fortune3 = "Be cautious of your new neighbours.";
const fortune4 = "You will find a new hobby soon.";
const fortune5 = "It would be wise to avoid the colour red today.";
const fortune5 = "It would be wise to avoid the color red today.";
let randomNumber = Math.floor(Math.random() * 5) + 1;

View File

@ -179,7 +179,7 @@ They adjust the padding and margin of an element.
---
They set the background colour and font style of an element.
They set the background color and font style of an element.
---

View File

@ -55,13 +55,13 @@ function contrast(rgb1, rgb2) {
return (brightest + 0.05)
/ (darkest + 0.05);
}
const backgroundColour = [27, 27, 50];
const backgroundColor = [27, 27, 50];
for (let elem of document.querySelectorAll('li > a')) {
const a = getComputedStyle(elem)?.color;
const rgbA = a?.match(/(\d+),\s(\d+),\s(\d+)/);
const aColour = [rgbA[1], rgbA[2], rgbA[3]];
assert.isAtLeast(contrast(backgroundColour, aColour), 7);
const aColor = [rgbA[1], rgbA[2], rgbA[3]];
assert.isAtLeast(contrast(backgroundColor, aColor), 7);
}
```

View File

@ -36,17 +36,17 @@ function contrast(rgb1, rgb2) {
return (brightest + 0.05)
/ (darkest + 0.05);
}
const backgroundColour = [42, 42, 64];
const backgroundColor = [42, 42, 64];
const foot = getComputedStyle(document.querySelector('footer'))?.color;
const a = getComputedStyle(document.querySelector('footer a'))?.color;
const rgbFoot = foot?.match(/(\d+),\s(\d+),\s(\d+)/);
const rgbA = a?.match(/(\d+),\s(\d+),\s(\d+)/);
const footColour = [rgbFoot[1], rgbFoot[2], rgbFoot[3]];
const aColour = [rgbA[1], rgbA[2], rgbA[3]];
assert.isAtLeast(contrast(backgroundColour, footColour), 7);
assert.isAtLeast(contrast(backgroundColour, aColour), 7);
const footColor = [rgbFoot[1], rgbFoot[2], rgbFoot[3]];
const aColor = [rgbA[1], rgbA[2], rgbA[3]];
assert.isAtLeast(contrast(backgroundColor, footColor), 7);
assert.isAtLeast(contrast(backgroundColor, aColor), 7);
```
# --seed--