- From: Giovanni Campagna <scampa.giovanni@gmail.com>
- Date: Tue, 28 Apr 2009 16:55:51 +0200
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: Bert Bos <bert@w3.org>, www-style@w3.org
2009/4/28 Tab Atkins Jr. <jackalmage@gmail.com>: > On Tue, Apr 28, 2009 at 8:14 AM, Giovanni Campagna > <scampa.giovanni@gmail.com> wrote: >> 2009/4/28 Bert Bos <bert@w3.org>: >>>[...] >>> >>>> >>>> 3. Some examples have suggested that template slots deal with borders >>>> and padding the same way table cells do, but this may not be quite >>>> clear enough. So I would recommend adding at least one more example >>>> with expected rendering of a template with various combinations of >>>> paddings, borders, margins applied to slot elements. >>> >>> The main purpose of the template was to position elements, not to add any >>> new decorations. Some people asked for backgrounds on slots. They were easy >>> to specify and don't influence the layout, so they were added. But borders >>> are much harder. The borders in the draft are only set on elements, not on >>> slots. Unless there is a convincing case for adding more borders than there >>> are elements, I prefer to keep the templates as simple as possible... >> >> Actually, you need borders as soon as you put more elements inside the >> slot, and you want a border/padding covering the whole slot without >> using additional elements. >> You can fake it setting border-top on the first element, border-bottom >> on the last and left / right on elements in the middle, but I'm not >> sure that is the way to go (you most of time need additional classes / >> IDs for those elements). >> This also applies if you have a template row/column greater than the >> element inside the slot, and you want to align borders between slots. > > Giovanni got it in one. Both of those are exactly my reasons for > wanting borders on slots (and padding). The draft essentially creates > a phantom container element, and I want to be able to *style* that > container! I forgot "display" (for values "table", "block" and "box") and "columns" too. >> Summing up, I think that the following properties should be allowed >> for ::slot: padding, border (including border-image), position (only >> relative) and top/left/right/bottom/z-index, page break related >> properties (to avoid breaking rows/columns). > > Can you expand on that last one? I understand the rest, but can't > quite get what you'd use the page-break properties for. I may don't want to break inside a row, like what happens for table-cells (that are never broken), and I cannot set page-break-inside on the actual elements, because the UA may split between two consecutive blocks (unless I set page-break-before / page-break-after, but I get the same problem as border, ie I need to find the first and the last in the slot) >> Also I would like to see allowed by Selectors Level 4 the combinations >> ::slot(a)::before and ::slot(a)::after, to insert text inside slots, >> without inserting it into elements (that may have border / padding) > > Wouldn't work - ::before and ::after are siblings to their superior > parent. You'd need ::inside first (and have it applicable to ::slot). No. ::before and ::after are inside their superior, before and after actual content of the element (I made the same mistake once) > ~TJ > Giovanni
Received on Tuesday, 28 April 2009 14:56:32 UTC