You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2014/08/28 03:21:58 UTC

[jira] [Closed] (TAP5-1883) Add a way to order/priorize stylesheets

     [ https://issues.apache.org/jira/browse/TAP5-1883?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-1883.
--------------------------------------

    Resolution: Won't Fix

You should consider using a JavaScriptStack and adding your CSS files there; that gives you full control over ordering.

> Add a way to order/priorize stylesheets
> ---------------------------------------
>
>                 Key: TAP5-1883
>                 URL: https://issues.apache.org/jira/browse/TAP5-1883
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3.2
>            Reporter: Beat Durrer
>            Priority: Minor
>              Labels: annotation, stylesheet
>
> Issue:
> The order of CSS in a HTML page is important for overriding styles.
> Its a common practice to define an overall style and have some different layouts which override some specific parts of it.
> When using multiple nested Layout components or Components which extend each other, the @Import annotation does not help here, because it does not let you order the styles. The default order seems to go from most-specific to the outermost (most generic) component. So the most generic component's CSS is "stronger" than the most specific one.
> Currently I see 4 workarounds:
> - Place the @Import on different render methods. But that's limited by the amount of render methods (and some of those might be called very often, some might never be called).
> - manually place the stylesheets in the template (not recommended because of possible iterations).
> - Create a MarkupWriterFilter which manipulates the DOM
> - Create a mixin or an uppermost Layout component which handles the CSS.
> Suggestion:
> - Add some way to priorize/order the stylesheets. Maybe similar to the OrderedConfiguration?
> - Add a hook to let us reorder the stylesheets before they are rendered (ex. in JavaScriptSupport)



--
This message was sent by Atlassian JIRA
(v6.2#6252)