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

get rid of cells.color and cells.background_color and replace with specific cells. #6

Open
braxtonmckee opened this issue Jul 9, 2019 · 7 comments

Comments

@braxtonmckee
Copy link
Contributor

I use 'color' to change the color of octicons and buttons, mostly for purposes of indicating that they are inactive. I use 'background_color' to indicate that a line item in a tree-nav I built is selected, or to style a nav-pane.

I think we could replace these 'color' objects by giving octicon, text, and Button a formal color argument. We can replace the background_color uses with some more specific ux elements (e.g. Panel that has a selected argument, or HeaderBar and EmbeddedPanel that have some visual styling with a coherent look and feel. In general, I'd like to move most colors out of the code and make more specific UX verbs that correspond to the visual elements we actually see. It's better to have many different specific-purpose visual elements than it is to have a trillion hard-coded colors floating around in client code.

@dkrasner
Copy link
Contributor

I am working on this and related styling updates in cells/components.

Is it fair to say that you want every method found in Cell._divStyle() (height, width, color etc) to be eventually removed and whatever necessary, i.e. whatever can't be properly auto-styled on the client side, included as explicit arguments in the cell class init method?

For example, Octicon('alert', color='red').

@braxtonmckee
Copy link
Contributor Author

braxtonmckee commented Jul 17, 2019 via email

@dkrasner
Copy link
Contributor

ok sorry I am going to start adding arguments to small components like Octicon so we can get closer to having no real style computations on the server side

for example, Octicon will have an api like Octicon('alert', color='red')

yes?

@braxtonmckee
Copy link
Contributor Author

braxtonmckee commented Jul 17, 2019 via email

@dkrasner
Copy link
Contributor

ok sounds good. Note this will be a breaking change then, b/c the Octicon cell will now pass color only through the color arg, i.e. self._divStyle() will not be called.

@dkrasner
Copy link
Contributor

Another way to approach the css properties (like background color) is to create a design spec that describes exactly what each type of cell will be.

This is exactly the purpose of a UX design spec - to create a uniform style for all types of visual objects and their displays. So we could go down this line: all buttons of this type have this style, all tables this etc etc

this way we don't have to create extra display: none/modifier cells, and ways to handle that, and the python programmer has less to think about. If at some point core design features need to be changed that can be done in a the application css file(s).

@braxtonmckee
Copy link
Contributor Author

braxtonmckee commented Aug 14, 2019 via email

@braxtonmckee braxtonmckee transferred this issue from APrioriInvestments/typed_python Oct 8, 2019
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