ONLYOFFICE / DesktopEditors

An office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents
https://www.onlyoffice.com
Other
2.76k stars 318 forks source link

CSS theming #1301

Closed Heath123 closed 2 months ago

Heath123 commented 1 year ago

This issue is unique.

Your idea.

It would be nice if there was a way to load custom CSS themes. Or is this already possible with the plugin system?

regs01 commented 1 year ago

The engine itself does support CSS theming. And there are multiple built-in themes. So it's indeed would good to let community create own themes. Changes would be minimal. Just look up for external themes in a specific directory, like %AppData%/OnlyOffice/themes in Windows and ~/.config/OnlyOffice/themes in nixes.

World be also nice to split off iconsets from themes. But that would require some work.

And let change color of titlebar.

Rita-Bubnova commented 1 year ago

Hello, @Heath123 and @regs01. Thank you for question. I think, this guide will help you. If so, can we close the issue?

regs01 commented 1 year ago

There is a folder AppData\Local\ONLYOFFICE\DesktopEditors in Windows. Can you also make it read themes somewhere from there, where admin rights are not required.

Heath123 commented 1 year ago

Hello, @Heath123 and @regs01. Thank you for question. I think, this guide will help you. If so, can we close the issue?

Thanks, a colour theme is nice but isn't quite what I'm looking for here because I wanted a way to load arbitrary CSS which would allow much deeper customisation. If this JSON file had a field for this it would be perfect, but I'm not sure if there are security issues. Also, the documentation is for the web apps, is this available for the desktop editors too?

regs01 commented 1 year ago

Hello, @Heath123 and @regs01. Thank you for question. I think, this guide will help you. If so, can we close the issue?

Thanks, a colour theme is nice but isn't quite what I'm looking for here because I wanted a way to load arbitrary CSS which would allow much deeper customisation. If this JSON file had a field for this it would be perfect, but I'm not sure if there are security issues. Also, the documentation is for the web apps, is this available for the desktop editors too?

It is CSS, not just color themes. And couple of years ago, when I tried to make another theme, abandoned half way through though, icons were set as background in CSS.

Heath123 commented 1 year ago

Hello, @Heath123 and @regs01. Thank you for question. I think, this guide will help you. If so, can we close the issue?

Thanks, a colour theme is nice but isn't quite what I'm looking for here because I wanted a way to load arbitrary CSS which would allow much deeper customisation. If this JSON file had a field for this it would be perfect, but I'm not sure if there are security issues. Also, the documentation is for the web apps, is this available for the desktop editors too?

It is CSS, not just color themes. And couple of years ago, when I tried to make another theme, abandoned half way through though, icons were set as background in CSS.

The documentation only mentions setting colour variables, I didn't see anything about CSS?

regs01 commented 1 year ago

The documentation only mentions setting colour variables, I didn't see anything about CSS?

Looked up on it, and it looks like you are right. There is no way to connect color theme with CSS. Prebuilt themes are all stored in a single CSS file app.css for each app. While theme JSON only allow you to change some colors variables and does not allow you to connect it with own CSS file.

More than that. I tried making a color theme. Created file c:\Program Files\ONLYOFFICE\DesktopEditors\editors\web-apps\apps\common\main\resources\themes\amazing-test.json with next content, but it does not appear in list of themes.

{
    "name": "Amazing theme",
    "l10n": {
        "fr": "Thème incroyable",
        "de": "Geweldig thema"
      },
    "id" : "theme-amazing",
    "type" : "light",
    "colors" : {
        "toolbar-header-document" :  "#446995",
        "toolbar-header-spreadsheet" : "#40865c",
        "toolbar-header-presentation" : "#aa5252",
        "border-color-shading" : "rgba(0, 0, 0, 0.15)"
    }
}
Rita-Bubnova commented 1 year ago

Sorry, this can't be done in the Desktop Editors right now. I created issue #63751 so that we can add it in one of the future versions.

matveevms commented 7 months ago

In the new version, which will be released soon, we have added the ability to add interface themes using .json files. If you have questions about how this functionality works, you can ask them in this issue. Thank you for your request.

regs01 commented 7 months ago

Still, it would be good to have ability to attach CSS file to the theme. JSON only allows to change colors, but not layout (paddings, margins, borders, dimensions etc) and icons.

Also, if JSON file missing some parameters, like l10n, or has an error, Setting page won't fully load.

editors_2024-02-01_10-43-49 editors_2024-02-01_10-46-27
matveevms commented 7 months ago

@regs01 Could you please issue a separate issue for this so that I can assign a new number for your request?

Rita-Bubnova commented 2 months ago

DesktopEditors v8.1.0 is released so I close this issue. Feel free to comment or reopen it if you got further questions.