-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
Move color keywords into their own page #14615
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4de0b74
Move color keywords in their own page
teoli2003 cb19ae9
Fix links to <color>
teoli2003 8d84db0
Typos
teoli2003 e411900
Move notes about evolution near the end of the article
teoli2003 9534e35
Fix color_keywords link
teoli2003 7f7075c
Improve intro
teoli2003 debae62
Add backlink
teoli2003 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,16 @@ tags: | |
--- | ||
{{CSSRef}} | ||
|
||
**Color keywords** are case-insensitive identifiers that represent a specific color, such as `red`, `blue`, `black`, or `lightseagreen`. Although the names more or less describes their respective colors, they are essentially artificial, without a strict rationale behind the names used. | ||
**Color keywords** are case-insensitive identifiers representing a specific color, such as `red`, `blue`, `black`, or `lightseagreen`. Although the names more or less describe their respective colors, they are essentially artificial, without a strict rationale behind the terms used. | ||
|
||
All keywords specify a color in the [sRGB color space](https://en.wikipedia.org/wiki/SRGB). | ||
|
||
There are a few caveats to consider when using color keywords: | ||
|
||
- [HTML](/en-US/docs/Web/HTML) only recognizes the 16 basic color keywords found in CSS Level 1, using a specific algorithm to convert unrecognized values (often to completely different colors). The other color keywords should only be used in CSS and [SVG](/en-US/docs/Web/SVG). | ||
- Unlike HTML, CSS will completely ignore unknown keywords. | ||
- The color keywords all represent plain, solid colors, without transparency. | ||
- [HTML](/en-US/docs/Web/HTML) only recognizes the 16 basic color keywords (`black`, `silver`, `gray`, `white`, `maroon`, `red`, `purple`, `fuchsia`, `green`, `lime`, `olive`, `yellow`, `navy`, `blue`, `teal`, and `aqua`). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW I like this a lot more |
||
- An algorithm converts all other values (a CSS color keyword or a random string) to a color (leading most of the time to completely different colors than the CSS color associated in the table below). Therefore, color keywords beside these 16 values should only be used in CSS and [SVG](/en-US/docs/Web/SVG), but not in HTML. | ||
- Unlike HTML, CSS completely ignores unknown keywords. | ||
- The color keywords all represent plain, solid colors without transparency. | ||
- Several keywords are aliases for each other: | ||
|
||
- `aqua` / `cyan` | ||
|
@@ -32,6 +33,8 @@ There are a few caveats to consider when using color keywords: | |
|
||
- In addition to the color keywords, the [`<color>`](/en-US/docs/Web/CSS/color_value) data type supports other keywords: [`transparent`](/en-US/docs/Web/CSS/color_value#transparent_keyword) to create a wholly transparent color, [`currentColor`](/en-US/docs/Web/CSS/color_value#currentcolor_keyword) that represents the value of an element's {{Cssxref("color")}} property lets you use the `color` value on properties that do not receive it by default, as well as _[system color keywords](/en-US/docs/Web/CSS/color_value#system_colors)_ that reprensents colors that matches those of the OS. | ||
|
||
## List of all color keywords | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW I would probably have left as "that represent"