Ableton / aqt-stylesheets

Apply CSS style sheets to QML applications
Other
214 stars 39 forks source link

Support for URL #4

Closed nil-ableton closed 9 years ago

nil-ableton commented 9 years ago

URL values can be included in a CSS file as described in the W3 document: http://dev.w3.org/csswg/css2/syndata.html#uri

Using such url values would help with locating resources/assets/etc..

I would expect the Style engine to resolve urls for me automatically and return an absolute URL resolved from the path containing the stylesheet itself (as described in the standard)

With a CSS file like so:

ComponentA {
    image: url(assets/images/hello.png)
}

And a qml file

ComponentA {
    Component.onCompleted: {
        console.log('image', StyleSet.props.url("image");
    }
}

Would return

file:///<directory containing the css>/assets/image/hello.png
gck-ableton commented 9 years ago

This is implemented with Aqt.StyleSheets 1.2. Thus closing this request.

nil-ableton commented 9 years ago

:+1: