More color field validation needed in theme settings?

Shopify Expert
172 0 3

We can save blank values in color fields in theme settings. See logo colors below...

"So what" I hear you say. Well here's the issue...

If I'm using a SASS stylesheet it gets completely borked (syntax error) and the site appears naked.

Shopify, please add more validation on the color field to make sure it contains a valid color.

John --- http://experts.shopify.com/patternhead --- www.rawsterne.co.uk --- http://twitter.com/patternhead --- A few Shopify sites that I've worked on... http://oreedesign.com/ ::: www.carstache.com ::: www.waltzingmousestamps.com ::: http://shoprustyknuckles.com ::: www.papermash.co.uk ::: http://shop.mulberryroad.com
0 Likes
Shopify Expert
465 0 35

I would actually disagree with forcing a color... OR you need to be able to accept transparent as a valid color. There have been a lot of situations where I don't want a color in a theme setting area which then forces me to edit the CSS manually. I am a fan of the transparent ability 

Trevor www.carlowseo.com
0 Likes
Shopify Expert
172 0 3

Hmm, well we'll have to agree to disagree on that :)

If the theme settings are asking for a color then there should be a way to make sure that field is required. A blank color field won't make something transparent but it will cause errors in standard CSS files. The BIG issue is that it causes errors when compiling SASS files.

John --- http://experts.shopify.com/patternhead --- www.rawsterne.co.uk --- http://twitter.com/patternhead --- A few Shopify sites that I've worked on... http://oreedesign.com/ ::: www.carstache.com ::: www.waltzingmousestamps.com ::: http://shoprustyknuckles.com ::: www.papermash.co.uk ::: http://shop.mulberryroad.com
0 Likes
Shopify Expert
465 0 35

Why not make the CSS sheet smart then?

{% if settings.somecolor == ''%}white{%else%}{{settings.somecolor}}{%endif%}

At the end of the day the transparent color will either have to be entered as blank, or the core css sheet made to transparent anyway.

Sorry a bit of a newb but do you pull the SASS information from the theme settings I assume? How do you handle when there is no option for a color in a theme then?

Trevor www.carlowseo.com
0 Likes
Shopify Expert
172 0 3

This isn't about transparent colors. It's about colors that I want to capture in theme settings.

John --- http://experts.shopify.com/patternhead --- www.rawsterne.co.uk --- http://twitter.com/patternhead --- A few Shopify sites that I've worked on... http://oreedesign.com/ ::: www.carstache.com ::: www.waltzingmousestamps.com ::: http://shoprustyknuckles.com ::: www.papermash.co.uk ::: http://shop.mulberryroad.com
0 Likes
Shopify Expert
465 0 35

Just trying to help... In my opinion if you are developing the theme settings, and the css sheets then you put the defaults in to the CSS. If there is some code consuming that information not the native css sheet, put a default in there if the value is blank.

There are viable reasons to either not have an option for a color in the theme settings, or to leave them blank... 

 

Trevor www.carlowseo.com
0 Likes
Shopify Expert
172 0 3

That's where we differ dude. In my opinion, there's no valid reason to allow a blank color field in theme settings.

Anyways we aren't gonna agree on that so let's see if anyone else has any thoughts :)

John --- http://experts.shopify.com/patternhead --- www.rawsterne.co.uk --- http://twitter.com/patternhead --- A few Shopify sites that I've worked on... http://oreedesign.com/ ::: www.carstache.com ::: www.waltzingmousestamps.com ::: http://shoprustyknuckles.com ::: www.papermash.co.uk ::: http://shop.mulberryroad.com
0 Likes
Shopify Expert
3937 16 325

That whole theme setup system is awful. In my mind it is nothing more than a prototype that was established when nothing else existed and it remains today. 

Everytime I hack a theme and deal with that settings system I cringe. I feel for theme designers. I know some of them probably think it is the neatest thing since sliced bread but it reminds me of the patterns of .Net, Java, Flex et al. where everything is an XML file wrapped in some forms. YUCK! Let's all go back a decade and wave our neon glowsticks!

I am sure the next iteration of this (see Timber)... will be far superior and this kind of theme configuration will disappear. There seems to be little reason to hang on to this old clunker... can't wait for the next iteration... working on themes may become more enjoyable instead of a drag.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Shopify Expert
172 0 3

Haha yup neon glowsticks, now that takes me back :)

Maybe we can have an animated dancing glowstick when someone sets a blank value in the color field?

Seriously though, allowing something simple like the required attribute would make sense and would allow more control. The required attribute isn't allowed now and the settings file won't save :(

 

John --- http://experts.shopify.com/patternhead --- www.rawsterne.co.uk --- http://twitter.com/patternhead --- A few Shopify sites that I've worked on... http://oreedesign.com/ ::: www.carstache.com ::: www.waltzingmousestamps.com ::: http://shoprustyknuckles.com ::: www.papermash.co.uk ::: http://shop.mulberryroad.com
0 Likes
Shopify Expert
465 0 35

I don't think it is the neatest thing since sliced bread (or dancing glowsticks :) )

I also agree that maybe some of the issue is to enable the ability for required attributes on the settings... would solve a lot of other potential problems as well!

Maybe a simple change to that color box would be to force a default value of say white... this means that if they actively remove it they risk breaking something

I also think they need the transparent option in there... sorry to keep coming back to it but it is a gap in that color pickers functionality to ensure that the css sheets don't break as Raw pointed out

Trevor www.carlowseo.com
0 Likes