We need to update the CSS definitions to use em instead of px, because em adapts with the font size.
An em is a unit of measurement, relative to the size of the font; therefore, in a typeface set at a font-size of 16px, one em is 16px.
Update all pixel definitions (px) to em. This is not an easy task, because the em value depends on the font size, but the px size is a hard coded one.
- Find the next
px entry in Base.css
- Check the code where the CSS definition is used
- Open JabRef and start that functionality
- Change the value to some em value
- Restart JabRef
- Change the font size to 12pt.
- Check if it looks nice
- Change the font size to 18pt.
- Check if it looks nice
- If not: Try other em value.
This takes a long time, because there are over 20 such values.
Please take screenshots before and after to ease reviewing.
Background material: https://openjfx.io/javadoc/22/javafx.graphics/javafx/scene/doc-files/cssref.html (linked from https://devdocs.jabref.org/code-howtos/javafx.html#resources, too)
Preparation
All .css definitions are spread around in the code base. We need to have them all in one Base.css to be able to work on some CSS issues.
Migrate all CSS files to the Base.css. For instance: https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/gui/texparser/ParseLatexResult.css
Notes
Do not touch Dark.css. It needs to be kept for dark mode support. It does not contain any px values, because it does color only.
We need to update the CSS definitions to use
eminstead ofpx, becauseemadapts with the font size.Update all pixel definitions (
px) toem. This is not an easy task, because theemvalue depends on the font size, but the px size is a hard coded one.pxentry inBase.cssThis takes a long time, because there are over 20 such values.
Please take screenshots before and after to ease reviewing.
Background material: https://openjfx.io/javadoc/22/javafx.graphics/javafx/scene/doc-files/cssref.html (linked from https://devdocs.jabref.org/code-howtos/javafx.html#resources, too)
Preparation
All .css definitions are spread around in the code base. We need to have them all in one
Base.cssto be able to work on some CSS issues.Migrate all CSS files to the Base.css. For instance: https://github.com/JabRef/jabref/blob/main/src/main/java/org/jabref/gui/texparser/ParseLatexResult.css
Notes
Do not touch Dark.css. It needs to be kept for dark mode support. It does not contain any
pxvalues, because it does color only.