Stop writing CSS that is not accurate. Stop rewriting my code

Please write my code accurately and don’t “round things off”. Please stop rewriting my code! It is my code. I wrote it and I own it.

This may not seem like a big deal as long as you stay insides the Blocs system, but try editing CSS after the fact, or in another CSS editor after the site has been published.

Example: Why can’t the user set an opacity to something other than a round number? If I set the opacity of some text in Blocs at 75%, Blocs rewrites my code and changes 75% to 80%. If I wanted the opacity to be 80% I would have set it to that.

Example: Colors and CSS names: If I create a color swatch that is red, and set the color of an item like a DIV to this color, Blocs thinks up some kind of arbitrary name and adds it to the styles.css file - in this case it is called “bgc-burgundy”

If Blocs gives me the ability to give swatches names, then I expect the CSS to also show this name in the Stylesheet.

Here are some examples of arbitrary CSS names given to some of the color swatches in one of my projects by Blocs:

.bgc-burgundy{
background-color:#8F0414;
}

.bgc-lavender-gray-2{
background-color:#C7CED1;
}
.bgc-apple-green{
background-color:#79B406;
}
.bgc-davys-grey{
background-color:#595E63;
}

.tc-davys-grey{
color:#595E63!important;
}
.tc-paynes-grey{
color:#3B3F47!important;
}
.tc-paynes-grey-2{
color:#3B3F47!important;
}

Im currently working on the new CSS editor so I’ll be sure to try and refine this.

EDIT: I’ve just updated this throughout Blocs so you will now find the colour alpha value respects 2 digit values and no longer rounds them. The patch is included in Blocs 3.4.3.

As for the global swatch names that has been the case since Blocs v1, its just the way global swatches work, you couldn’t rely on a class simply being called red to not cause problems . If its a problem, I recommend you write your own custom classes and apply colour that way.

1 Like