-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Contrast plugin suggestion preview - Fixes #21
This adds a checkbox next to the suggested color combination which will toggle between original colors and suggested colors. In order to embed the functionality for the checkbox I had to modify all plugins to pass their descriptions as jQuery objects (with the blessing of @jdan of course). It might be worth discussing if there is a better way to represent the control for this than a checkbox; it seemed like the cleanest and simplest way to me but I can see that it might not be very intuitive, especially without a label.
- Loading branch information
Showing
10 changed files
with
100 additions
and
51 deletions.
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
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
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
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 |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<p> | ||
The color combination | ||
<span class="tota11y-color-hexes">{{fgColorHex}}/{{bgColorHex}}</span> | ||
has a contrast ratio of <strong>{{contrastRatio}}</strong>, which is not | ||
sufficient. At this size, you will need a ratio of at least | ||
<strong>{{requiredRatio}}</strong>. | ||
</p> | ||
<div> | ||
<p> | ||
The color combination | ||
<span class="tota11y-color-hexes">{{fgColorHex}}/{{bgColorHex}}</span> | ||
has a contrast ratio of <strong>{{contrastRatio}}</strong>, which is not | ||
sufficient. At this size, you will need a ratio of at least | ||
<strong>{{requiredRatio}}</strong>. | ||
</p> | ||
|
||
<p> | ||
Consider using the following foreground/background combination: | ||
</p> | ||
<p> | ||
Consider using the following foreground/background combination: | ||
</p> | ||
|
||
<div class="tota11y-contrast-suggestion"> | ||
<span class="tota11y-color-hexes"> | ||
{{suggestedFgColorHex}}/{{suggestedBgColorHex}} | ||
</span> | ||
|
||
<span class="tota11y-swatches"> | ||
<span | ||
class="tota11y-swatch" | ||
style="background-color: {{suggestedFgColorHex}}"> | ||
</span> | ||
/ | ||
<span | ||
class="tota11y-swatch" | ||
style="background-color: {{suggestedBgColorHex}}"> | ||
<div class="tota11y-contrast-suggestion"> | ||
<span class="tota11y-color-hexes"> | ||
{{suggestedFgColorHex}}/{{suggestedBgColorHex}} | ||
</span> | ||
</span> | ||
|
||
has a ratio of | ||
<span class="tota11y-swatches"> | ||
<span | ||
class="tota11y-swatch" | ||
style="background-color: {{suggestedFgColorHex}}"> | ||
</span> | ||
/ | ||
<span | ||
class="tota11y-swatch" | ||
style="background-color: {{suggestedBgColorHex}}"> | ||
</span> | ||
</span> | ||
|
||
<strong>{{suggestedColorsRatio}}</strong> | ||
has a ratio of <strong>{{suggestedColorsRatio}}</strong> <input class="previewCb" type="checkbox"> | ||
</div> | ||
</div> |
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
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
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
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
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
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