{"action":"created","issue":{"url":"https://api.github.com/repos/brigade/scss-lint/issues/488","labels_url":"https://api.github.com/repos/brigade/scss-lint/issues/488/labels{/name}","comments_url":"https://api.github.com/repos/brigade/scss-lint/issues/488/comments","events_url":"https://api.github.com/repos/brigade/scss-lint/issues/488/events","html_url":"https://github.com/brigade/scss-lint/issues/488","id":86633159,"number":488,"title":"Inconsistency: rgb/rgba definitions are not flagged for variable-only usage as hex color definitions","user":{"login":"cH40z-Lord","id":439899,"avatar_url":"https://avatars.githubusercontent.com/u/439899?v=3","gravatar_id":"","url":"https://api.github.com/users/cH40z-Lord","html_url":"https://github.com/cH40z-Lord","followers_url":"https://api.github.com/users/cH40z-Lord/followers","following_url":"https://api.github.com/users/cH40z-Lord/following{/other_user}","gists_url":"https://api.github.com/users/cH40z-Lord/gists{/gist_id}","starred_url":"https://api.github.com/users/cH40z-Lord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cH40z-Lord/subscriptions","organizations_url":"https://api.github.com/users/cH40z-Lord/orgs","repos_url":"https://api.github.com/users/cH40z-Lord/repos","events_url":"https://api.github.com/users/cH40z-Lord/events{/privacy}","received_events_url":"https://api.github.com/users/cH40z-Lord/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-09T15:14:06Z","updated_at":"2015-06-10T07:44:57Z","closed_at":null,"body":"Today I've discovered a strange inconsistency between color definitions. SCSS-Lint is throwing a warning whenever you try to use a color definition like `#fff` outside of a SCSS variable. However, this is not true for colors defined via `rgb()` and `rgba()`, which feels kinda strange and not what I expect.\r\n\r\n```css\r\n.foo {\r\n  // warning: foo.scss:2 [W] ColorVariable: Color literals like `#fff` should only be used in variable declarations; they should be referred to via variable everywhere else.\r\n  backgorund-color: #fff;\r\n}\r\n\r\n.bar {\r\n  // no warning/error\r\n  background-color: rgba(255, 255, 255, .5);\r\n  //background-color: rgb(255, 255, 255);\r\n}\r\n```\r\n\r\nI'd love to have an option for this as well so we can improve our SCSS code even more. What do you think?"},"comment":{"url":"https://api.github.com/repos/brigade/scss-lint/issues/comments/110639326","html_url":"https://github.com/brigade/scss-lint/issues/488#issuecomment-110639326","issue_url":"https://api.github.com/repos/brigade/scss-lint/issues/488","id":110639326,"user":{"login":"apfelbox","id":1032411,"avatar_url":"https://avatars.githubusercontent.com/u/1032411?v=3","gravatar_id":"","url":"https://api.github.com/users/apfelbox","html_url":"https://github.com/apfelbox","followers_url":"https://api.github.com/users/apfelbox/followers","following_url":"https://api.github.com/users/apfelbox/following{/other_user}","gists_url":"https://api.github.com/users/apfelbox/gists{/gist_id}","starred_url":"https://api.github.com/users/apfelbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apfelbox/subscriptions","organizations_url":"https://api.github.com/users/apfelbox/orgs","repos_url":"https://api.github.com/users/apfelbox/repos","events_url":"https://api.github.com/users/apfelbox/events{/privacy}","received_events_url":"https://api.github.com/users/apfelbox/received_events","type":"User","site_admin":false},"created_at":"2015-06-10T07:44:57Z","updated_at":"2015-06-10T07:44:57Z","body":"Maybe regression by #402?\r\n\r\nHere is my understanding / proposal of the `ColorVariable` linter:\r\n\r\n| Type                                            | Code Examples                    | SHOULD report? | DOES CURRENTLY report? |\r\n| ----------------------------------------------- | -------------------------------- | -------------- | ---------------------- |\r\n| **Regular color definition**                    | `color: red;`                    | yes            | yes ✓                  |\r\n|                                                 | `color: #fff;`                   | yes            | yes ✓                  |\r\n|                                                 | `color: #ffffff;`                | yes            | yes ✓                  |\r\n|                                                 | `color: rgb(0, 100, 200);`       | yes            | **no ✗**               |\r\n|                                                 | `color: rgb(0%, 50%, 80%);`      | yes            | **no ✗**               |\r\n|                                                 | `color: rgba(0, 0, 0, .5);`      | yes            | **no ✗**               |\r\n|                                                 | `color: hsl(0, 100%, 50%);`      | yes            | **no ✗**               |\r\n|                                                 | `color: hsla(0, 100%, 50%, .5);` | yes            | **no ✗**               |\r\n| **Special CSS keywords**                        | `color: currentColor;`           | no             | no ✓                   |\r\n|                                                 | `color: inherit;`                | no             | no ✓                   |\r\n| **Resetting a color**                           | `color: transparent;`            | no             | no ✓                   |\r\n| **Directly using a variable**                   | `color: $red;`                   | no             | no ✓                   |\r\n| **Transforming a variable value in a function** | `color: rgba($red, .5);`         | no             | no ✓                   |\r\n|                                                 | `color: lighten($red, 5%);`      | no             | no ✓                   |\r\n\r\n\r\nTested with scss-lint 0.39.0 and sass 3.4.14"}}