gss / engine

GSS engine
http://gss.github.io
MIT License
2.86k stars 105 forks source link

Syntax-Behavior Inconsistency #143

Closed gsklee closed 5 years ago

gsklee commented 9 years ago

Given this following HTML:

<form id="data-filter">
    <label id="a">
        <select>
            <option value="">Date</option>
        </select>
    </label>
    <label id="b">
        <select>
            <option value="">Time</option>
        </select>
    </label>
    <label id="c">
        Group by
        <select>
            <option value="">Region</option>
        </select>
    </label>
</form>

According to the docs, the following 3 syntaxes should give the same outcome while in the latest version (1.0.4-beta) they are not:

@h |-[#a]-100-[#b]-100-[#c]-| in(form) chain-width(250); Img1

@h |-[#a(250)]-100-[#b(250)]-100-[#c(250)]-| in(form); Img2

@h label in(form) gap(100) outer-gap(0) chain-width(250); Img3

paulyoung commented 9 years ago

@gsklee thanks for reporting this. We should try this in the new version of GSS (breaking changes, docs coming soon) and see if it's still an issue.

In the meantime, there seems to be some inconsistency between the 3 examples, which might explain some of this.

The 3rd example suggests that the outer-gap should be 0 in all 3, yet the default gap is being used.

Something like this would be more accurate:

@h |[#a]-100-[#b]-100-[#c]| in(form) chain-width(250);
@h |[#a(250)]-100-[#b(250)]-100-[#c(250)]| in(form);
@h label in(form) gap(100) outer-gap(0) chain-width(250);
gsklee commented 9 years ago

Thanks for the correction - will be waiting for the new release then.