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

Widget styling #2518

Open
zerline opened this issue Jul 26, 2019 · 5 comments
Open

Widget styling #2518

zerline opened this issue Jul 26, 2019 · 5 comments

Comments

@zerline
Copy link
Contributor

zerline commented Jul 26, 2019

Hi. Do we intend to extend the styling possibilities through the widgets_style.Style?

For instance, we (at sagemath) would like to have:

  • text color
  • borders
  • background image

---- tiny brainstrorming ----
For a button, background-image could be called button_image. background as such could also exist and be called background (and not only for buttons).
---- end ----

Is there a reason to limit ourselves? Could we not just accept every CSS property when applicable, changing the name only for some of them?

@zerline
Copy link
Contributor Author

zerline commented Jul 26, 2019

For images, additionnally to URLs, we could also accept SVG strings and transform them to get the right syntax and optimization ..

@jasongrout
Copy link
Member

jasongrout commented Jul 26, 2019

Hi. Do we intend to extend the styling possibilities through the widgets_style.Style?

Yes. We've been extending things as users request them.

Is there a reason to limit ourselves? Could we not just accept every CSS property when applicable, changing the name only for some of them?

We used to have arbitrary CSS styling. However, essentially this makes the DOM structure part of the api, and the new styling system is an effort to put a level indirection between styling options and the DOM structure (so we can change the DOM structure now without breaking backwards compatibility). As such, each styling addition creates a maintenance burden on us to maintain. That's why we've been conservative and adding to the styles when there were specific requests for needs people actually had.

Note that the Layout provides many styling properties for the top-level DOM element, including borders. The Style system is primarily for styling elements inside the widget.

@zerline
Copy link
Contributor Author

zerline commented Aug 3, 2019

Thanks @jasongrout. I'll probably come back later with more precise requirements.

@zerline
Copy link
Contributor Author

zerline commented Dec 22, 2019

Sagemath on Jupyter users, and Sage Combinat Widgets/Sage Explorer users, would really like to be able to change display attributes programmatically, the simplest way possible .. like:

  1. background color, text color etc ..
  2. background image (arbitrary images)
  3. single borders like border-right, border-left etc..
  4. visibility

@zerline
Copy link
Contributor Author

zerline commented Dec 22, 2019

See also #2611

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

2 participants