The frontend for Euro-Office Document Server and Euro-Office Desktop Editors. Builds the program interface and allows the user create, edit, save and export text documents, spreadsheets, and presentations.
Until 2019-10-23 the repository was called web-apps-pro.
Official website: https://github.com/Euro-Office
Code repository: https://github.com/Euro-Office/web-apps
If you have any problems with or questions about Euro-Office Document Server, please visit our official forum: github.com/euro-office or you can ask and answer Euro-Office development questions on [Stack Overflow][3].
Styling is accomplished via LESS, there is the content set by Euro-Office. Before you do anything, please read the section under this about modifications.
There are several hundred LESS files, organised in several folders:
apps/common/embed/resources/less/
apps/common/forms/resources/less/
apps/common/main/resources/less/
apps/common/main/resources/mods/less/
apps/common/mobile/resources/less/Common is the most important and many of the others just import common.
They use variables:
apps/common/main/resources/less/variables.less <- majority seem to be shared from there.
The variables seem to be a bit haphazard in approach. There is some structure, but not uniformly adhered to. The variables are used in other files, so the lack of structure is not so much an issue.
Importing is via relative paths.
apps/documenteditor/embed/resources/less/
apps/documenteditor/forms/resources/less/
apps/documenteditor/main/resources/less/
apps/documenteditor/mobile/src/less/apps/spreadsheeteditor/main/resources/less/
apps/spreadsheeteditor/mobile/src/less/apps/presentationeditor/embed/resources/less/
apps/presentationeditor/main/resources/less/
apps/presentationeditor/mobile/src/less/apps/pdfeditor/main/resources/less/apps/visioeditor/main/resources/less/Each directory has a range of LESS files broken down by area, eg slider, search, buttons etc - too many to list here, but should be helpful in finding the correct place to make style changes
Run docker compose from the euro-office/fork/build directory:
# From euro-office/fork/build, enter the container:
docker compose exec eo bash
# Then inside the container:
export BUILD_NUMBER=0 THEME=euro-office && cd /var/www/onlyoffice/web-apps-develop/build && grunt --skip-imagemin --skip-babel| Flag | Description |
|---|---|
--skip-imagemin |
Skip image optimization (faster builds) |
--skip-babel |
Skip ES5 transpilation for IE compatibility (modern browsers only, no ie/ directory created) |
| Variable | Description |
|---|---|
THEME |
Theme name to use (e.g., euro-office, default) |
BUILD_NUMBER |
Build number for versioning |
To build this project execute the following commands
cd build
npm install
grunt [optional grunt command]A build directory can be specified by using an env variable
BUILD_ROOT=/path/to/build grunt [optional grunt command]Two new build-time variables were introduced to the code to remove hard-coded paths and make the build configuration more flexible:
BUILD_ROOT
SRC_ROOTSeveral JSON files define build instructions and previously contained hard-coded relative paths, for example:
build/common.json
build/presentationeditor.json
build/documenteditor.json
...These paths have been replaced with the $BUILD_ROOT variable. During the build process, $BUILD_ROOT is resolved to the actual build root directory, allowing the same configuration to work regardless of where the project is built or deployed.
Some HTML files include inline script replacements during the build (for example, apps/api/documents/cache-scripts.html). The referenced JavaScript paths were previously in SRC_ROOT relative to the file location in BUILD_ROOT.
These paths have been updated to use the @@SRC_ROOT@@ placeholder instead. At build time, this placeholder is replaced with the absolute source directory, ensuring that script references resolve correctly in all environments.
We want to make upstream updates as painless as possible. From the perspective of making modifications we have added theming capability to the office package.
Each theme is a self-contained folder under theme/ at the web-apps root:
theme/euro-office/
meta/
config.json # Brand values (company name, URLs, logo filenames)
assets/
img/header/ # Logo SVGs (copied to desktop + mobile resource dirs at build time)
less/ # LESS variable overrides and CSS rule overrides
Contains brand values that replace {{PLACEHOLDER}} tokens in JS and webpack DefinePlugin constants. Priority: environment variable > config.json > hardcoded default.
Note: Mobile and forms logo fields (
mobile_logo_*,forms_logo_*) are in this file because the mobile editors use webpack, not Grunt.build/theme.config.mjsreadsconfig.jsondirectly to provide LESSglobalVars(logo paths) andDefinePluginconstants (brand values) for the mobile webpack builds. This makesconfig.jsonthe shared contract between the Grunt build (desktop) and the webpack build (mobile).
{
"company_name": "Euro Office",
"publisher_name": "Euro Office",
"publisher_url": "https://github.com/Euro-Office",
"publisher_address": "",
"publisher_phone": "",
"sales_email": "",
"support_email": "",
"support_url": "https://github.com/Euro-Office",
"help_url": "https://github.com/Euro-Office",
"app_title": "Euro Office",
"mobile_logo_light": "eo_logo_light.svg",
"mobile_logo_dark": "eo_logo_dark.svg",
"forms_logo_light": "eo_logo_dark.svg",
"forms_logo_dark": "eo_logo_light.svg"
}THEME=euro-office gruntThe deploy-theme task runs first and:
- Reads
config.jsonintoglobal.themeMetafor brand replacements - Copies images to
apps/common/main/resources/img/(desktop) andapps/common/mobile/resources/img/(mobile) - Copies LESS to
apps/common/main/resources/less/themes/{THEME}/
LESS compilation and JS replacements then proceed as normal with theme files in place.
- Copy
theme/euro-office/totheme/yourtheme/ - Edit
meta/config.jsonwith your brand values - Replace logo SVGs in
assets/img/header/ - Adjust LESS variables in
assets/less/theme.less - Build with
THEME=yourtheme
Use variables in theme.less as much as possible — this avoids duplicate CSS in the final output. Only use overrides/ for rules that cannot be changed via variables. The overrides directory should mirror the structure of the main app for clarity.
web-apps is released under an GNU AGPL v3.0 license. See the LICENSE file for more information.