-
Notifications
You must be signed in to change notification settings - Fork 9
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
Style properties #13
Comments
Worth double checking that this still works, and updating docs if so: https://github.com/henrikjoreteg/bind-transforms |
+1 this probably needs to be done at least to match class bindings, i.e. style, booleanStyle, switchStyle |
+1 I run across the same issue, needing to set the width & left of an element using bindings |
@legastero @wraithgar @ConneXNL @herkyl |
@pgilad could you give a code example of what exactly you are thinking of |
// Use as a regular binding
var bindings = domBindings({
'model.name': {
type: 'text',
selector: '.any-selector',
transform: function(value, binding) {
return value + '%';
}
}
}); |
'model.width': {
cssProp: 'width',
selector: '.any-selector',
transform: function(value, binding) {
return value + 'px';
}
} What about something like this? |
I was suggesting a |
When working with ampersand-dom-bindings I came accros an issue where I want to change the width of a block element. I had to generate a style like string "width: " + percentage + "%;" to tackle the use case. It would be handy to have ampersand-dom-bindings to also be able to change CSS aka Style properties directly.
I am not sure if this should be covered in the ampersand-dom repo.
The text was updated successfully, but these errors were encountered: