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

More customizable CSS #902

Merged
merged 4 commits into from
Mar 23, 2022
Merged

More customizable CSS #902

merged 4 commits into from
Mar 23, 2022

Conversation

Badatos
Copy link
Contributor

@Badatos Badatos commented Feb 25, 2022

Hello !
First, I want to thank you for this useful tool.
I made some minor CSS change to allow a stand alone opencast server to use more customizable colors, with css vars.
Added vars :

  • --theme-ui-colors-btn-hover (hover bg color for buttons)
  • --theme-ui-colors-button_fg (button foreground color)
  • --theme-ui-colors-controls (text color for video player controls)
  • --theme-ui-colors-info (bg color for an 'info' panel (like in video parameters popup)
  • add a "role=button" on download link for better accessibility.

Hello !
First, I want to thank you for this useful tool.
I made some minor CSS change to allow a stand alone opencast server to use more customizable colors, with css vars.
Added vars :
* --theme-ui-colors-btn-hover (hover bg color for buttons)
* --theme-ui-colors-button_fg (button foreground color)
* --theme-ui-colors-controls (text color for video player controls)
* --theme-ui-colors-info (bg color for an 'info' panel (like in video parameters popup)

+ add a "role=button" on download link for better accessibility.
@lkiesow
Copy link
Contributor

lkiesow commented Feb 25, 2022

Hi @Badatos, thanks for the contribution.
Can you explain how someone would use these?
They aren't available from the configuration, are they?

@Badatos
Copy link
Contributor Author

Badatos commented Feb 28, 2022

Hello Lars!
To customise this app by now, we can for sample add one link to a custom.css file in the public/index.html file :
<link rel="stylesheet" type="text/css" href="custom.css">
and put in this custom.css file our brand colors, for sample:

/* pink theme */
#root {
  --theme-ui-colors-primary: #b03c7e;
  --theme-ui-colors-btn-hover: #93326a;
}

... or another sample :

/* dark theme */
:root {
  --theme-ui-colors-background: #303238;
  --theme-ui-colors-text: #FFF;
}
#root {
  --theme-ui-colors-info: #737373;
  --theme-ui-colors-gray-3: #797676;
}

@Badatos
Copy link
Contributor Author

Badatos commented Feb 28, 2022

another way is to load opencast app inside another website, and apply directly the main website's CSS;

@lkiesow
Copy link
Contributor

lkiesow commented Mar 1, 2022

Seems like a goood idea. But one thing that is definitely missing from this patch is documentation about this. No one will ever know or remember if we do not add this.

Also, this is really hard to use in this form. Users would actually need to modify the code. What if we just add a simple style or theme configuration which would simply drop the configured value into a <style> tag on the main page. The configuration could the be used like this (applying your theme):

theme = """
:root {
  --theme-ui-colors-background: #303238;
  --theme-ui-colors-text: #FFF;
}
#root {
  --theme-ui-colors-info: #737373;
  --theme-ui-colors-gray-3: #797676;
}
"""

This would be much more convenient for adopters to use and should be relatively easy to implement.

@Badatos
Copy link
Contributor Author

Badatos commented Mar 2, 2022

Good idea Lars.
I just add it in my branch : now user can directly add customised CSS in a customCSS param (in [theme] section of settings)
and I added a sample of use in configuration.md to help users.

@Badatos
Copy link
Contributor Author

Badatos commented Mar 11, 2022

is it ok for you @lkiesow ?

@lkiesow
Copy link
Contributor

lkiesow commented Mar 14, 2022

Hi @Badatos, sorry, I was busy with the Opencast Summit last week and had no time to look at this. Will do so tomorrow.

@lkiesow
Copy link
Contributor

lkiesow commented Mar 16, 2022

Merged into the current master branch, I get the following error. Maybe because a newer (stricter) version of TypeScript is being used?

Screenshot from 2022-03-16 13-13-33

You built your patch on a somewhat old state of this project, can you rebase your patch or merge it with master?

@Badatos
Copy link
Contributor Author

Badatos commented Mar 16, 2022

Hello @lkiesow.
I just merged master with my branch, and tested again and I can't see this error. When does it appears ?

The "npm run build" command does not raise it for me.

@Badatos
Copy link
Contributor Author

Badatos commented Mar 16, 2022

Ok, I see it : it happens when there is no [theme] entry in settings.toml.
I try to correct this.

@Badatos
Copy link
Contributor Author

Badatos commented Mar 16, 2022

New commit pushed ! Thank you for the testing @lkiesow, it works now ;)

@lkiesow lkiesow merged commit 56b6bb3 into elan-ev:master Mar 23, 2022
@lkiesow
Copy link
Contributor

lkiesow commented Mar 23, 2022

Thanks for fixing this. Merged.

lkiesow added a commit to lkiesow/opencast-studio that referenced this pull request Mar 23, 2022
Pull request elan-ev#902 allows users to specify color themes for Studio. The
background of the main input selection buttons when hovering over them
is unfortunately hard-coded to pure white though, making a dark theme
basically impossible to specify.

This patch sets the background color dynamically based on the main color
instead by just slightly brightening the color. The default looks
basically the same and specifying dark themes is now a lot easier.
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