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

refactor: make theme variant_user_selectable default to OS theme if not previously set #495

Conversation

iisakkirotko
Copy link
Collaborator

No description provided.

Copy link
Collaborator Author

iisakkirotko commented Feb 5, 2024

@iisakkirotko iisakkirotko force-pushed the 02-05-feat_support_theming_solara branch from 0599961 to f8b0e84 Compare February 5, 2024 14:56
@iisakkirotko iisakkirotko force-pushed the 02-05-refactor_make_theme_variant_user_selectable_default_to_OS_theme_if_not_previously_set branch from 44a4a16 to b76c207 Compare February 5, 2024 14:56
@iisakkirotko iisakkirotko force-pushed the 02-05-feat_support_theming_solara branch from f8b0e84 to 5a324e6 Compare February 5, 2024 15:03
@iisakkirotko iisakkirotko force-pushed the 02-05-refactor_make_theme_variant_user_selectable_default_to_OS_theme_if_not_previously_set branch from b76c207 to 69e5295 Compare February 5, 2024 15:03
@iisakkirotko iisakkirotko force-pushed the 02-05-feat_support_theming_solara branch from 5a324e6 to c71d5c3 Compare February 5, 2024 15:23
@iisakkirotko iisakkirotko force-pushed the 02-05-refactor_make_theme_variant_user_selectable_default_to_OS_theme_if_not_previously_set branch from 69e5295 to 562911d Compare February 5, 2024 15:23
@iisakkirotko iisakkirotko force-pushed the 02-05-feat_support_theming_solara branch from b4d6684 to 10fe4e7 Compare February 8, 2024 16:09
maartenbreddels and others added 15 commits February 8, 2024 17:13
Creates a reactive variable that is set to the return value of the function.

The value will be updated when any of the reactive variables used in the function
change.

Example:
```solara
import solara
import solara.lab

a = solara.reactive(1)
b = solara.reactive(2)

@solara.lab.computed
def total():
    return a.value + b.value

def reset():
    a.value = 1
    b.value = 2

@solara.component
def Page():
    print(a, b, total)
    solara.IntSlider("a", value=a)
    solara.IntSlider("b", value=b)
    solara.Text(f"a + b = {total.value}")
    solara.Button("reset", on_click=reset)
```

z.value will be lazily executed the first time, and will be updated
when one of the dependencies changes.
Creates a reactive variable that is set to the return value of the function.

The value will be updated when any of the reactive variables used in the function
change.

Example:
```solara
import solara
import solara.lab

a = solara.reactive(1)
b = solara.reactive(2)

@solara.lab.computed
def total():
    return a.value + b.value

def reset():
    a.value = 1
    b.value = 2

@solara.component
def Page():
    print(a, b, total)
    solara.IntSlider("a", value=a)
    solara.IntSlider("b", value=b)
    solara.Text(f"a + b = {total.value}")
    solara.Button("reset", on_click=reset)
```

z.value will be lazily executed the first time, and will be updated
when one of the dependencies changes.
Both are very similar, but Singleton will never re-compute,
both are not settable (read-only).

Example:
```python
from solara.toestand import Computed, Reactive

x = Reactive(1)
y = Reactive(2)

def conditional_add():
    if x.value == 0:
        return 42
    else:
        return x.value + y.value

z = Computed(conditional_add)
```

z.value will be lazily executed the first time, and will be updated
when one of the dependencies changes.
use_task can replace use_thread, but also support coroutine functions.

task is a decorator that creates a top level task that can be executed
from any location (e.g. a click handler of a button).
@iisakkirotko iisakkirotko force-pushed the 02-05-feat_support_theming_solara branch from 10fe4e7 to f58e32e Compare February 8, 2024 16:14
@iisakkirotko iisakkirotko force-pushed the 02-05-refactor_make_theme_variant_user_selectable_default_to_OS_theme_if_not_previously_set branch from 562911d to ed0ec10 Compare February 8, 2024 16:14
@iisakkirotko iisakkirotko force-pushed the 02-05-feat_support_theming_solara branch from f58e32e to d03f038 Compare February 9, 2024 11:57
@iisakkirotko iisakkirotko force-pushed the 02-05-feat_support_theming_solara branch 3 times, most recently from c41779e to 162cf58 Compare February 21, 2024 08:11
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.

None yet

2 participants