Skip to content

Theming with css#71

Draft
rdbende wants to merge 1 commit into
masterfrom
css-theme
Draft

Theming with css#71
rdbende wants to merge 1 commit into
masterfrom
css-theme

Conversation

@rdbende
Copy link
Copy Markdown
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
Copy Markdown

Maybe add this to the docs?

@rdbende
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Moosems commented Apr 27, 2022

We want to add this?

@rdbende
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Moosems commented Apr 28, 2022

Sounds great!

@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
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
Member Author

rdbende commented Jan 7, 2023

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

@athrvvvv
Copy link
Copy Markdown

athrvvvv commented Jan 7, 2023

bruhhh

@rdbende
Copy link
Copy Markdown
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

None yet

Development

Successfully merging this pull request may close these issues.

4 participants