Another benefit of relying purely on CSS - A quick way to alter colors if needed which comes in handy when making changes for different states. It also makes development pretty rapid and aids quick style guide developing.
Unless I'm overlooking something there, it doesn't make much sense to use RGBA whilst you have 100% opacity for each color as the opacity declaration isn't needed and you would need to specify alternatives for other browsers anyway - rendering the RGBA declarations pointless.
You are correct. I what I pasted here was at 100% opacity which would be pointless. I was just trying to see if it was possible since I really hadn't done css gradient. :)
9 Responses
Pro
Dave McNally
Another benefit of relying purely on CSS - A quick way to alter colors if needed which comes in handy when making changes for different states. It also makes development pretty rapid and aids quick style guide developing.
almost 2 years ago
Pro
Steven Ray
So you're using CSS gradient here?
almost 2 years ago
Pro
Dave McNally
Yup. Here's the CSS used for the default button if you're interested:
almost 2 years ago
Pro
Dave McNally
Yikes....should probably link to a stylesheet from now on ;)
almost 2 years ago
Pro
Steven Ray
Awesome! Thanks Dave!
almost 2 years ago
Pro
Steven Ray
Hey I played around and used rgba with your gradient code.
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(27, 99, 171, 1)), to(rgba(20, 72, 122, 1)));
background: -moz-gradient(linear, 0% 0%, 0% 100%, from(rgba(27, 99, 171, 1)), to(rgba(20, 72, 122, 1)));
almost 2 years ago
Pro
Dave McNally
Unless I'm overlooking something there, it doesn't make much sense to use RGBA whilst you have 100% opacity for each color as the opacity declaration isn't needed and you would need to specify alternatives for other browsers anyway - rendering the RGBA declarations pointless.
almost 2 years ago
Pro
Steven Ray
You are correct. I what I pasted here was at 100% opacity which would be pointless. I was just trying to see if it was possible since I really hadn't done css gradient. :)
almost 2 years ago
Pro
Dave McNally
Ah! Yeah, it's great being able to get away with a minimal amount of imagery.
almost 2 years ago