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

Theming with css #71

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Theming with css #71

wants to merge 1 commit into from

Conversation

rdbende
Copy link
Member

@rdbende rdbende commented Apr 17, 2022

Theming with css in Tukaan

app.theme = CssTheme(Path("./themes/sun-valley.css"))

sun-valley.css :

@source('./images/light');  /* Specify the image resource path */
@parent('clam');  /* Set parent theme (default is clam) */


$bg-color: #fafafa;
$fg-color: #202020;
$disabled-color: #a0a0a0;
$select-color: #ffffff;
$select-bg-color: #2f60d8;


* {
    /* Global settings */
    font-family: 'Segoe UI', sans;
    font-size: 10px;
    background: $bg-color;
    color: $fg-color;
    field-background: $bg-color;
}

*:focus {
    color: $select-bg-color;
}

*:disabled {
    color: $disabled-color;
}

*::caret {
    /* Global caret-styling */
    width: 1px;
    color: $fg-color;
}

*::selection {
    /* Global selection colors */
    background: $select-bg-color;
    color: $select-color;
}

button,
button:selected {
    image: $button-rest;  /* Use a loaded image for the widget */
    border: 4px;  /* How much to crop them image when stretching */
    padding: 8px 4px;  /* Padding inside the widget */
    anchor: center;
    sticky: nsew;
}

button:hover {
    image: $button-hover;
    color: #1a1a1a;
}

button:pressed {
    image: $button-pressed;
    color: #636363;
}

button:disabled,
button:selected:disabled {
    image: $button-disabled;
    color: #a2a2a2;
}

@sumeshir26
Copy link

Maybe add this to the docs?

@rdbende
Copy link
Member Author

rdbende commented Apr 18, 2022

Maybe add this to the docs?

Yeah, I'll add it as soon as this feature is finished (currently it only parses the css file, but doesn't generate a Tcl theme script from it).
Actually I started writing the theming section in the docs several times, but haven't finished it yet.

@Moosems
Copy link
Collaborator

Moosems commented Apr 27, 2022

We want to add this?

@rdbende
Copy link
Member Author

rdbende commented Apr 28, 2022

Will add it! I'm in the process of writing a comprehensive tutorial on theming, and that will include CSS stuff.

@Moosems
Copy link
Collaborator

Moosems commented Apr 28, 2022

Sounds great!

@rdbende rdbende added this to In progress in Theming May 16, 2022
@rdbende rdbende mentioned this pull request Jul 1, 2022
10 tasks
@rdbende rdbende added the Area: theming Look and feel related stuff label Jul 2, 2022
Copy link

@athrvvvv athrvvvv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@rdbende
Copy link
Member Author

rdbende commented Jan 7, 2023

No it doesn't

@rdbende rdbende marked this pull request as draft January 7, 2023 19:23
@rdbende
Copy link
Member Author

rdbende commented Jan 7, 2023

It's at most a tenth of what it should be.

@athrvvvv
Copy link

athrvvvv commented Jan 7, 2023

bruhhh

@rdbende
Copy link
Member Author

rdbende commented Jan 7, 2023

This isn't even a complete CSS parser.

@rdbende rdbende mentioned this pull request Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: theming Look and feel related stuff
Projects
No open projects
Theming
In progress
Development

Successfully merging this pull request may close these issues.

None yet

4 participants