New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stylesheets #405
Comments
I have a few commits that allow you to set "null" on certain properties (e.g. Text/Rectangle color). This would then allow you to style them, as they would not be overwritten in the "style" attribute with the default QML value. I also have a commit that adds the "objectName" to the "class" attribute, allowing some more control over styling. If you're interested I can publish them. |
Hi Stephen, it would be great! |
Yes, that should be possible. As upstream Qt does not support that, the target for that should be in a separate module — and that module is QmlWeb.DOM. Currently, it just supports something like this: import QtQuick 2.0
import QmlWeb.Dom 0.1
Item {
DomElement {
tagName: "code" // the tag that you are constructing
}
} Those could be nested. But the idea is to add properties/css/js initializers there, so that any HTML components could be reused using |
@tezine Here are the commits I'm using: https://github.com/stephenmdangelo/qmlweb/tree/css_styling_support You can use it as follows: QML:
css:
@ChALkeR I didn't submit a PR for these, as I don't know if this is a thing we want to actively support? Maybe just the |
@stephenmdangelo I have no objections to adding classes based on Commit What could be done here to make the compat break a visible opt-in is to define an attached property in module For example: import QtQuick 2.0
import QmlWeb.Dom 0.1
Text {
Dom.noStyle: true
Dom.id: 'myElement'
Dom.className: 'red box'
} I am not sure how exactly could we achieve that and I'm personally not planning working on that, but that approach makes the behaviour difference clearly visible and makes it an opt-in. |
@ChALkeR I agree wholeheartedly. In fact, that is the exact reason I was looking into properly supporting attached properties a while back. |
60759ee landed an now allows to do this: import QtQuick 2.0
import QmlWeb.Dom 1.0
DomElement {
width: 100
height: 200
attrs.id: 'myElement'
style.background: 'green'
} |
Hi,
QmlWeb is awesome! It's great to have the qml syntax for web development!
I have only one concern. Since there are many free components already created using html/css, I'd like to know if there is some way to "insert" them into qmlweb "Qt Quick Controls".
It would be great if we could create QML controls using already created Vuejs components or if we could style qmlweb components using css files.
I know this would break compatibility with QML, but imagine the following cenario:
I'm using QML Web controls and I want to style a Button. It would be nice if I could apply a css into it or even create the Button using Vuejs and use it in QMLWeb. All with anchors and QML syntax.
Is this possible?
Bruno.
The text was updated successfully, but these errors were encountered: