Re: [css3-background] alternatives to background-origin

Bert Bos wrote:
> On Monday 19 May 2008 07:30, L. David Baron wrote:
>> On Tuesday 2008-05-13 23:28 -0700, fantasai wrote:
> 
> Related to ISSUE-13 (and ISSUE-24):
> 
>>> Rename 'background-origin' to 'background-box'
>>>   http://www.w3.org/Style/CSS/Tracker/issues/46 ISSUE-46
>>>
>>>   Resolve: Bert and I tentatively accept this suggestion, but are
>>> open to better names.
>>>
>>>   http://krijnhoetmer.nl/irc-logs/css/20080512#l-715
>>>   http://krijnhoetmer.nl/irc-logs/css/20080513#l-3
>> I don't think this is a good name, since it then becomes unclear how
>> the property is different from 'background-clip'.  Given that there
>> are *two* boxes involved (currently called origin and clip), I don't
>> think either should just be called "box".
> 
> I suspect there exists a solution that uses one property less, probably 
> the 'background-origin' property, because that is the one whose effect 
> is the most indirect. But what might that solution be?
> 
> Adding the keywords of 'background-origin' on 'background-position' 
> and 'background-size' is one way, but it means the keywords (sometimes) 
> have to be repeated on two properties.
> 
> Merging 'background-origin' and 'background-clip' might be another. If 
> it is true (as some people expect) that the clip rectangle and the 
> origin will either be the same or will be as they were in CSS2, then of 
> the current 12 possible combinations of clip and origin, we only 
> actually need 5:
> 
>     background-clip: border-box | padding-box | content-box | 
>         no-clip | normal
> 
> The first three set both the clip rectangle and the origin rectangle for 
> computing size and position to the given box. The last two set the 
> origin rectangle to the padding edge (the default, and the only one in 
> CSS2) and set the clip rectangle to the border edge and the viewport, 
> resp.
> 
> Does this inspire anybody?
> 
> 
> 
> Bert


Why not remove background-size and background-clip altogether and go 
along with four coordinates on background-position along with 
background-origin.


background-position: 0 0 0 0; /* left top right bottom */


Then authors could just write:


background-position: 0 auto auto 0; /* left top right bottom */
background-origin: content;


And to clipped the top and left of the image all one needs to do is:


background-position: -100px auto auto -100px;


This would position the background image outside the content box, thus 
clipping the top and left portion of the image by 100px.


Alan

http://css-class.com/test/

Received on Wednesday, 21 May 2008 03:44:45 UTC