W3C home > Mailing lists > Public > www-style@w3.org > August 2013

RE: [css-regions] margin of first paragrah of a region

From: Mihai Balan <mibalan@adobe.com>
Date: Mon, 19 Aug 2013 11:27:37 +0100
To: François REMY <francois.remy.dev@outlook.com>, "www-style@w3.org" <www-style@w3.org>, Mihnea-Vlad Ovidenie <mihnea@adobe.com>
CC: Laurence Mclister <lmcliste@adobe.com>, Sylvain Galineau <galineau@adobe.com>
Message-ID: <32E5AE8565CC6142BA0AAFA5A95697E04D24267D84@eurmbx01.eur.adobe.com>
I'm not sure it can be done at this very moment.
But the way I would see it done, would be via some next-level fragmentation-specific pseudo-class. Something like (using the older @region syntax that is likely to re-become the current one):

@region .region {
  p:first-fragment /* or p:first-visual-child */ {
    margin-top: 0;

Makes sense?

Mihai Balan | Quality Engineer @ Web Engine team |  mibalan@adobe.com | +4-031.413.3653 / x83653 | Adobe Systems Romania

-----Original Message-----
From: François REMY [mailto:francois.remy.dev@outlook.com] 
Sent: Saturday, August 17, 2013 1:39 AM
To: www-style@w3.org; Mihnea-Vlad Ovidenie
Cc: Laurence Mclister; Sylvain Galineau
Subject: RE: [css-regions] margin of first paragrah of a region

Sylvain just notified me my mail client had the "brillant idea" of transforming my paragraphs into line-breaks...

Each time you sea a <BR>, the original source code contained a paragraph...

> From: francois.remy.dev@outlook.com
> To: www-style@w3.org; mihnea@adobe.com
> CC: lmcliste@adobe.com
> Date: Fri, 16 Aug 2013 23:20:31 +0200
> Subject: [css-regions] margin of first paragrah of a region
> Issue of the day: inter-paragraph margin.
> Let's pretend I was trying to port over this "manual-region" code to [css-regions]:
>   <div class="region">
>    Abc...<BR>
>    <figure>...</figure>
>    Def...<BR>
>   </div>
>   <div class="region">
>    <figure>...</figure>
>    Ghi...<BR>
>    Jkl...<BR>
>   </div>
>   p { margin: 10px }
>   figure { margin: 30px; }
>   .region {padding:5px}
>   .region> :first-child { margin-top: 0px; }
> How can I get this special effect that the first-paragraph in each region do not get pushed down by ther inter-paragraph margin?
> My current trick has been to put all the margin on the bottom of paragraphs (which is probably how things should be in this case) but it cannot possibly work if I've a <figure> sibling to my paragraphs which requires a 30px on both top and bottom (but still 0px top margin as first visual child of a box, ie: the margin collapses in the inter-region world).
> Any suggestion?
> François 		 	   		  
Received on Monday, 19 August 2013 10:28:10 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:33 UTC