Skip to content
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

Styling? #194

Open
rafaqz opened this issue Nov 15, 2017 · 3 comments
Open

Styling? #194

rafaqz opened this issue Nov 15, 2017 · 3 comments

Comments

@rafaqz
Copy link

rafaqz commented Nov 15, 2017

Is there a simple way to add css class/id/style tags to a widget?

@JobJob
Copy link
Member

JobJob commented Nov 15, 2017

No, would be nice if we could support the layout options here: http://ipywidgets.readthedocs.io/en/stable/examples/Widget%20Styling.html

Not sure if they offer a way to set class/id tags.

Adding a layout option might be doable by adding something like this to the view_state function https://github.com/JuliaGizmos/Interact.jl/blob/master/src/IJulia/setup.jl#L227

haskey(widget_layouts, w) && state[:layout] = widget_layouts[w]

# and somewhere above that in setup.jl
widget_layouts = Dict{Widget, Dict{Symbol, Any}}()

You'd have to check the way ipywidgets expects those things - you can try them in python and check the websocket messages in the browser console.

Disclaimer: It may not be as simple as that, but it's probably worth a shot

Also you might want to check/modify how hbox, vbox works, since it also uses layouts (in a slightly kludgy way) - see https://github.com/JuliaGizmos/Interact.jl/blob/master/src/IJulia/statedict.jl#L25

@rafaqz
Copy link
Author

rafaqz commented Nov 15, 2017

seems that ipywidgets has is a separate .style attribute for appearance, while .layout is for size related things. But I it's the same idea

@cancandan
Copy link

How to do styling?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants