Re: Shorthands resetting properties they cannot set

> On Dec 15, 2017, at 2:16, Daniel Glazman <daniel.glazman@disruptive-innovations.com> wrote:
> 
> Le 04/12/2017 à 20:49, François REMY a écrit :
> 
>> I furthermore disagree with the statement that says it is confusing that "border: something" resets "border-image", I really like when a property resets all the properties that have the same prefix, and find it confusing otherwise. If as an author you write "border: 3px solid white" you want a "3px solid white" border, and not sometimes this turn into non-white border because another rule in the document did set a border-image previously. 
> 
> Ah. Let's take *any* web editor based on CSS OM, not only BlueGriffon:
> 
>  1. apply "border-bottom: thin red solid" to an element
>  2. apply "border-top: thin red solid" to the same element
>  4. same thing with  "border-left" and "border-right"
> 
> EXPECTED BEHAVIOUR: web authors expect the "border: thin red solid"
>  shorthand to appear in the stylesheet they edit instead of the
>  longthands.
> 
> ACTUAL BEHAVIOUR: the four properties remain expanded as is... I saw one
>  editor serializing 'border-style", 'border-width' and 'border-color',
>  not sure it's better in any way...
> 
> This is what users complain (loudly) about because and I totally agree
> with them. We have changed a 20+ years old behaviour for some of the
> most used properties in CSS.


I agree with your observation that authors do not expect what they currently get in the situation you describe.

What I don't agree with is that this shows we should change.

I think that if we did change, authors would also be confused/frustrated, but about something else.

If an author writes "border: thin red solid" (with the right specificity) and they don't get a thin red solid border, they will complain even more loudly. That's why the border shorthand has to reset things like border-image.

I do not think we have the choice between a confusing solution and a non confusing solution. Both are confusing in different situations. I think the confusion that would arise if shorthands didn't reset all the related properties, even when they cannot set them, would be worse than the one you've been complaining about.

Again, I am not saying you are wrong: the situation you describe is confusing too. But it's a tradeoff, and the alternative seems worse to me.

—Florian

Received on Friday, 15 December 2017 02:14:30 UTC