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

Add style classes #136

Merged
merged 1 commit into from
Nov 2, 2023
Merged

Add style classes #136

merged 1 commit into from
Nov 2, 2023

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Nov 2, 2023

This adds style classes. They can be declared with the style_class! macro:

style_class!(pub Button);

There is a view decorator to apply them:

view.class(Button)

And a method on Style to apply styles only to a class:

s.class(Button, |s| s.border(1.0))

The scroll view now uses classes for the handle and track styles. The window scale example is updated to use a button class.

@dzhou121
Copy link
Contributor

dzhou121 commented Nov 2, 2023

This is really cool!

@dzhou121 dzhou121 merged commit 78cd924 into lapce:main Nov 2, 2023
7 checks passed
@Zoxc Zoxc deleted the style-classes branch November 2, 2023 17:26
jrmoulton pushed a commit to jrmoulton/floem that referenced this pull request Nov 6, 2023
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

Successfully merging this pull request may close these issues.

2 participants