Re: [css3-gcpm] border-length

On Wed, Oct 15, 2008 at 10:24 AM, Brad Kemper <brkemper.comcast@gmail.com>wrote:

>
>
> On Oct 15, 2008, at 4:07 AM, Håkon Wium Lie wrote:
>
>  Also sprach Håkon Wium Lie:
>>
>>  Now, there may be better or more powerful methods to express this. At
>>> the recent F2F it was requested that we find a way to express the
>>> "inverse" of border-length, where corners are hidden, but lines
>>> between them are visible.
>>>
>>> Proposals for how to address this is welcome; this is a fairly immature
>>> part of the specification.
>>>
>>
>> Answering my own request, how about a property that list visible
>> and invisible lengths, starting with a visible length. For example:
>>
>> border-parts: 1em auto 2em
>>
>
> I'm still trying to grasp what the spec is trying to achieve with
> border-length or border-parts. Is it so that there can be a short line above
> the footnotes?
>
> It seems to me that what you are starting to create is a way to specify the
> dashes and gaps in dashed borders, which would be very broadly useful, not
> just for this module. It could go into the borders module. So, for instance:
>
> border-top: 1px dashed black;
> dashes: 1em 2em;
>
> The above would create repeating 1em-wide dashes with 2em gaps. This would
> mean that if you had dashed borders on more than one side of the box, they
> would all share the same dash-gap pattern (as is the case today). To
> recreate your example in the quoted text above, you would do it almost the
> same:
>
> border-top: 1px dashed black;
> dashes: 1em auto 2em;
>
> This assumes that if you have more than two lengths, and at least one was
> "auto" (a flex unit, more or less), then the dashes would not repeat on that
> edge. Otherwise they would. For repeating dash-gap patterns then, you would
> probably need to have an even number of lengths:
>
> border: 1px dashed black;
> dashes: 12px 4px 2px 4px;
>
> In this example, the border would have a repeating pattern of 12px dash,
> 4px gap, 2px dash, and 4px gap. Something a little like this:
>
> ------  -  ------  -  ------  -  ------
>
> With this dash notation, you could create even more complex patterns:
>
> border: 1px dashed black;
> dashes: 12px 4px 10px 4px 8px 4px 6px 4px 8px 4px 10px 4px;


While I agree that the dashes: property would be completely awesome and
should definitely be a part of CSS, I don't think it's appropriate to
generalize for the use-case that border-parts covers.  As you yourself said,
if a flex unit appears in a dashes specification, the dashes don't repeat on
that edge.  It's not really a dashed border anymore, then, is it?  It's just
a customized solid border.

As well, border-parts allows you to use border-styles other than solid.  You
could do border-parts: 0 auto 30px auto and pair it with border-style:
dotted to do a nice little flourish at the bottom of a section, frex.  Right
now you have to do something like a custom <hr> to handle this.

Overall, I don't think that the use-cases that border-parts addresses
conceptually touch on dashed borders at all, even if you can generalize
dashed borders to handle it.  Frex, a project I was doing just last month
called for a fancy-styled list of items.  At the bottom of each <li> there
was to be a thick gray border, starting about 80px from the left edge and
then going to the end.  I simply can't do this without really screwing
around with markup currently, but border-parts would address it trivially
(border-parts: 0 80px auto).  This isn't conceptually a dashed border at
*all*, it's a solid border that just doesn't start for 80px.  I could just
as easily have been asked to create a dashed border that didn't start until
80px in, and then a solution that generalizes dashed borders would have
screwed me.  (As it was I just decided that it would be too annoying to deal
with, and ignored that part of the design.  Marketing didn't notice.)

~TJ

Received on Wednesday, 15 October 2008 17:45:34 UTC