question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

✨ Add `rgba()` color into `config.colors`

See original GitHub issue

Description

// master.css.js

export default {
    colors: {
        primary: '#22a3e5',  // works
        ['accordin-expanded']: 'primary/.4', // not works
        ['accordin-expanded']: 'rgba(0,0,0,0.4)' // not works
    }
}

We should allow config colors include rgba values and opacity shorthand.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
1aroncommented, Dec 20, 2022

We might implement the following syntax:

export default {
    colors: {
        primary: '#000', // HEX
        primary: 'rgb(0,0,0)', // RGB
        primary: 'rgb(0 0 0)', // RGB
        primary: 'rgb(0 0 0/.5)', // RGB
        primary: 'rgba(0,0,0,.5)', // RGBA
        primary: 'blue/.5'
     }
}
0reactions
1aroncommented, Dec 23, 2022

Is gradient also supported?

I think it mostly applies on background property, but generally it represents a color as well.

Or we should stick to use gradient only in config.values.

We can’t support it in config.colors because it contains multiple colors and behaves completely differently. You are right, we should stick to use gradient in config.values or config.classes to keep color configuration simple.

Read more comments on GitHub >

github_iconTop Results From Across the Web

rgba() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The rgba() functional notation expresses a color according to its red, green, and blue components. An optional alpha component represents ...
Read more >
CSS RGB and RGBA Colors - W3Schools
An RGB color value represents RED, GREEN, and BLUE light sources. RGB Value. In CSS, a color can be specified as an RGB...
Read more >
The Ultimate Guide to CSS Colors (2020 Edition)
There is much more to CSS colors than RGB, HEX, and HSL... let's see the status of CSS colors in 2020. Tagged with...
Read more >
The Power of the rgba() Color Function in CSS
If we have a navigation list inside a header element, we can add a background color with rgba() to the navigation. This will...
Read more >
A Guide to CSS RGBA Colors - WebFX
RGBA is a type of CSS color value that allows us to set a color and also its opacity/transparency. Here's an example of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found