accent-color
Quick Summary for accent-color
The accent-color CSS property sets the accent color for user-interface controls generated by some elements.
Code Usage for accent-color

<pre class="brush: css notranslate"><code><span class="token comment">/ Keyword values /</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> auto<span class="token punctuation">;</span> <span class="token comment">/ &lt;color&gt; values /</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> red<span class="token punctuation">;</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> #5729e9<span class="token punctuation">;</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> <span class="token function">rgb</span><span class="token punctuation">(</span>0<span class="token punctuation">,</span> 200<span class="token punctuation">,</span> 0<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> <span class="token function">hsl</span><span class="token punctuation">(</span>228<span class="token punctuation">,</span> 4%<span class="token punctuation">,</span> 24%<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment">/ Global values /</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> inherit<span class="token punctuation">;</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> initial<span class="token punctuation">;</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> revert<span class="token punctuation">;</span> <span class="token property">accent-color</span><span class="token punctuation">:</span> unset<span class="token punctuation">;</span> </code></pre>

More Details for accent-color

accent-color

The accent-color CSS property sets the accent color for user-interface controls generated by some elements.

Browsers that support accent-color currently apply it to the following HTML elements:

<input type="checkbox"> <input type="radio"> <input type="range"> <progress>

Syntax

/* Keyword values */ accent-color: auto;  /* <color> values */ accent-color: red; accent-color: #5729e9; accent-color: rgb(0, 200, 0); accent-color: hsl(228, 4%, 24%);  /* Global values */ accent-color: inherit; accent-color: initial; accent-color: revert; accent-color: unset; 

Values

auto

Represents a UA-chosen color, which should match the accent color of the platform, if any.

<color>

Specifies the color to be used as the accent color.

Formal definition

Initial valueauto
Applies toall elements
Inheritedyes
Computed valueauto is computed as specified and <color> values are computed as defined for the color property.
Animation typeby computed value type

Formal syntax

auto | <color>

where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>

where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )<hwb()> = hwb( [<hue> | none] [<percentage> | none] [<percentage> | none] [ / [<alpha-value> | none] ]? )

where <alpha-value> = <number> | <percentage><hue> = <number> | <angle>

Examples

Setting a custom accent color

HTML
<input type="checkbox" checked /> <input type="checkbox" class="custom" checked /> 
CSS
input {   accent-color: auto;   display: block;   width: 30px;   height: 30px; }  input.custom {   accent-color: rebeccapurple; } 
Result

Specifications

Specification
CSS Basic User Interface Module Level 4 # widget-accent

See also

The <input> element Applying color to HTML elements using CSS The <color> data type Other color-related properties: color, background-color, border-color, outline-color, text-decoration-color, text-emphasis-color, text-shadow, caret-color, and column-rule-color

Last modified: Nov 29, 2021, by MDN contributors

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
I believe that success can be measured in the number of uncomfortable conversations you're willing to have.
Unknown
Latest News
## 🚀 AI Giants Hit Bullseye: Anthropic & OpenAI Achieve Product-Market Fit Anthropic and OpenAI have reached a significant milestone, finding product-market fit with their AI technologies, which means their products effectively meet the needs of their customers, driving growth and adoption. This achievement showcases the practical value of their innovations, enabling businesses and individuals to leverage AI for enhanced productivity and efficiency. With this alignment of product and market needs, these companies are poised to transform industries and shape the future of technology.