Open core-ai-bot opened 3 years ago
Comment by peterflynn Tuesday Mar 11, 2014 at 18:46 GMT
@
larz0 Seems like there are two separate questions here: the swatch list in the lower-right, vs. the values we dynamically generate as you drag the sliders.
IIRC the swatch list is just a verbatim copy of your code, so if you don't use spaces then the swatch list won't use them either. For the dynamically picked colors though, seems like maybe we should have a preference or a checkbox here -- seems very much like a personal style preference.
Comment by larz0 Tuesday Mar 11, 2014 at 19:01 GMT
I see. Instead of a checkbox or preference I'm wondering if it could respect the original format for the dynamically generated colors?
Comment by peterflynn Wednesday Mar 12, 2014 at 04:41 GMT
It wouldn't be hard to look for other rgb()
colors in the same file and follow their example. But it seems like it could still be annoying if you're creating a new file and the first color the colorpicker creates is always wrong (since it has no examples to use). So I wonder if a pref of some sort is still the best way to go...
Comment by larz0 Wednesday Mar 12, 2014 at 19:27 GMT
I think a good default would be no spaces after commas in values. When someone quick edits a value with spaces Brackets should remember that and use that as the preferred format (instead of looking for other values in the same file automatically).
Comment by TomMalbran Wednesday Mar 12, 2014 at 19:37 GMT
Why not just check the original selection? I mean, if when we call the color editor, we had rgb(0,0,0)
don't use spaces after comas, but if we had rgb(0, 0, 0)
use them.
Comment by peterflynn Wednesday Mar 12, 2014 at 20:04 GMT
@
TomMalbran You may have started with something else like a hex color -- we auto-switch to rgba()
if you start dragging the alpha slider, plus there are buttons to manually switch format. There's also a user story somewhere about letting you open the colorpicker before you've written a value after CSS properties like color:
.
Comment by peterflynn Wednesday Mar 12, 2014 at 20:05 GMT
@
larz0 I really think it comes down to personal preference. I definitely prefer spaces as it aids readability. A lot of people (and JSLint) are pretty religious about using spaces after all commas in their imperative code, and that could easily carry over to CSS code they write too.
Comment by larz0 Wednesday Mar 12, 2014 at 20:19 GMT
Ok cool I'll think about this a bit more because this is probably bigger than just color values and rect(); there's also timing function and transform values.
Comment by TomMalbran Wednesday Mar 12, 2014 at 23:56 GMT
Oh, I didn't noticed that. I guess that a preference might be the easiest way to do this.
Comment by dangoor Wednesday Mar 19, 2014 at 18:11 GMT
Reviewed low priority to@
RaymondLim unless@
TomMalbran wants to add the pref...
Issue by larz0 Tuesday Mar 11, 2014 at 17:27 GMT Originally opened as https://github.com/adobe/brackets/issues/7157
"Don't include spaces after commas within rgb(), rgba(), hsl(), hsla(), or rect() values. This helps differentiate multiple color values (comma, no space) from multiple property values (comma with space)."