diff --git a/src/posts/css-accent-color.md b/src/posts/css-accent-color.md new file mode 100644 index 0000000..424613f --- /dev/null +++ b/src/posts/css-accent-color.md @@ -0,0 +1,40 @@ +--- +layout: "../layouts/BlogPost.astro" +title: "Use CSS accent-color to style your inputs" +slug: css-accent-color +description: "If you want a quick styling win, you can set a color for your input and progress HTML tags!" +added: "Jan 30 2024" +tags: [technical] +--- + +If you've ever wanted to style HTML `` tags in your projects, you know it's a bit tricky to deal with the labels and making everything look custom and themed. + +This won't go wildly into all the ways you can style them, BUT, if you want a quick win to change the color of those controls, use the CSS `accent-color` property! + +`accent-color` works on the following HTML elements: + +- `` +- `` +- `` +- `` + +You can style all of these by just plopping it in your root: + +```css +:root { + accent-color: #ccff00; +} +``` + +Or, if you want different elements to have different colors, you can style them all individually! + +

+ See the Pen + accent-color demo by Cassidy (@cassidoo) + on CodePen. +

+ + +[Here's the documentation](https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color) if you want to learn more! + +Byyyyye <3