This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
spec:css3-regions:regions-use-cases [2012/09/11 17:41] – astearns | spec:css3-regions:regions-use-cases [2014/12/09 15:48] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 124: | Line 124: | ||
wrap-flow: both; | wrap-flow: both; | ||
/* prevent the content from touching the edges of the box */ | /* prevent the content from touching the edges of the box */ | ||
- | | + | |
color: lightblue; | color: lightblue; | ||
font-size: 2em; | font-size: 2em; | ||
Line 235: | Line 235: | ||
flow-from: breaking-news; | flow-from: breaking-news; | ||
| | ||
- | /* allow scrolling when content overflows the region */ | + | /* allow scrolling when content overflows the last region |
- | region-overflow: auto; | + | region-fragment: auto; |
overflow: auto; | overflow: auto; | ||
} | } | ||
Line 286: | Line 286: | ||
</ | </ | ||
- | This works only if the class=" | + | This works only if the class=" |
- | + | ||
- | <code css> | + | |
- | .segment { | + | |
- | flow-into: combined-segments; | + | |
- | flow-from: combined-segments; | + | |
- | height: 50vh; | + | |
- | } | + | |
- | </ | + | |
==== Capturing region overflow content ==== | ==== Capturing region overflow content ==== | ||
Line 326: | Line 318: | ||
margin-top: | margin-top: | ||
- | /* This region will catch all the overflow | + | /* Control |
- | region-overflow:auto; | + | region-fragment:auto; |
overflow: | overflow: | ||
} | } | ||
Line 367: | Line 359: | ||
position: absolute; | position: absolute; | ||
/* prevent text from touching the edges of the slices */ | /* prevent text from touching the edges of the slices */ | ||
- | | + | |
} | } | ||
#slice_1 { | #slice_1 { | ||
Line 417: | Line 409: | ||
{{: | {{: | ||
+ | |||
+ | ==== Content re-ordering on the client ==== | ||
+ | |||
+ | There are content management systems that assemble markup on demand, but have limited options for changing the markup (and therefore the layout) based on the capabilities of the client that requests a page. One not-so-good solution is to offer a separate ' | ||
==== CSSOM use cases ==== | ==== CSSOM use cases ==== | ||
Line 422: | Line 418: | ||
The spec includes more than the usual amount of CSSOM, as the basic capabilities of named flows and region chains are very well suited to being extended via script. Here are some use cases for the scripting access included in the spec. | The spec includes more than the usual amount of CSSOM, as the basic capabilities of named flows and region chains are very well suited to being extended via script. Here are some use cases for the scripting access included in the spec. | ||
- | - Modifying the region chain based on content changes or window resizing. This could involve adding or removing CSS Regions, or changing region geometry. | + | - Modifying the region chain based on content changes or window resizing. This could involve adding or removing CSS Regions, or changing region geometry. This case makes use of the regionLayoutUpdate event for noticing when changes may be required Then the NamedFlow.overset, |
- | - Handing events on named flow contents - using the OM to determine the CSS Region(s) that contain the content. | + | - Modifying the content based on the region chain. This is the reverse of the first use case. If the size and position of the region chain is fixed, script can modify the contents (usually through font-size) to make it fit. This can take the form of enlarging headlines to fill the available space, or slightly reducing body text size to bring in a few lines of overset text. NamedFlow.overset is particularly useful here. |
- | - Layout extensions implemented via script (script-based layout constraints | + | - Handing events on named flow contents - using the OM to determine the CSS Region(s) that contain the content. NamedFlow.getRegionsByContent() allows you to move from the contents to the containers. |
- | - Paginated views that use script to navigate or search (use the OM to determine the page to display). | + | - Layout extensions implemented via script (script-based layout constraints). If you have a script-based layout system that uses a different set of constraints than existing CSS layout modes, script access to the region chain through NamedFlow.getRegions() and NamedFlow.getRegionsByContent() is required to solve the layout puzzle. |
+ | - Paginated views. Until pagination has an agreed-upon solution, |