acl-anthology
acl-anthology copied to clipboard
Update css & js
See commit messages for contents; mainly housekeeping and cleaning up a bit
Build successful. You can preview it here: https://preview.aclanthology.org/update-css-js This preview will be removed when the branch is merged.
This commit also fixes aria labels for the search box; forgot to mention that.
Together with a better caching policy for our assets and enabling http/2, this should make the site faster for slow connections. It is also the first step to proper minification of css and js.
Good point regarding bootstrap CSS -- I will bump that as well.
Re FontAwesomeCDN: The problem is as follows: fa is a css and a font (.woff2) resource. When we use a CDN, we need to load both from the CDN. This means:
- load html
- see that we need fa css, request that
- once fa css is there, request the font
- for both, we load everything even though we only use a small subset
Now:
- load html, css&font marked as preload
- css is merged with our main css, no overhead there
- font is requested from our site
With http/2, we only need a single connection in contrast to several and it does speed things up according to my measurements. Maybe we could also preload from the CDN, but then we rely on links to the fonts never changing in the externally hosted css.
When we serve fa ourselves, we can minify it and only serve the subset the anthology is actually using.
Note that bumping the Bootstrap CSS is a bit more involved, and would probably require careful checking of the migration guide here: https://getbootstrap.com/docs/5.0/migration/
* css is merged with our main css, no overhead there * font is requested from our site
Counterpoint would be that our CSS gets bigger, and the font always needs to be requested instead of potentially being reused from cache if the user already visited another site using FontAwesome before.
I'll leave this one to you two to resolve.
I made it a draft and will push this and that in the near future.
It might also be a good time to update Hugo, if it's not too much extra work. Our version is getting a bit dated. We could make this a general housekeeping update.
It might also be a good time to update Hugo
I already snuck in the relevant changes into this PR and use 0.85 locally :-)
@akoehn any interest in updating this and pushing it through? I’ll do my best to do a fast turnaround on a review.
Yes, I will continue to work on it soon-ish. Time to dust off my js&css skills from ~2004-2006 lol
I rebased and force-pushed this branch because I did not want to merge one year of work. This is still WIP, as a lot of CSS has changed (also, jquery was dropped)
I'm going through the CSS changes for bootstrap 5 and the behavior of badges has changed.
We are currently using badges in a lot of places where we provide a hyperlink (link to bibliography, code, PDF, ...) and bootstrap dropped support for hover on badges. I think they want badges to be non-clickable elements and push people to use buttons instead.
I tried using buttons but these are too big for the list view:
OTOH, the badges were quite small and maybe not that accessible. Thoughts?
I don't see a good reason to change the styling; the badges are currently as high as the text that follows, so if people find them too small they'd probably enlarge the entire site anyway. But that's just my guess, I'm happy to hear of other's experiences.
You could argue that semantically, these indeed act like buttons, which might make a difference from a semantic XML/screenreader etc. perspective. I don't have enough experience with that.
If the current behavior (w.r.t. to hovering etc.) can only be replicated with buttons in BS5, my first thought would be to make a CSS class btn-badgelike
or btn-tiny
or something, to emulate the look of the old badges. I would start by copying the source for the btn-sm
class, copy margin & padding values (and probably font size/style) from the old badges, and see where that gets us.
There are two possible approaches:
- make tiny buttons
- make "buttonized" badges (i.e. make them react to hover again)
I think I prefer the first one because it is cleaner and also probably easier to implement (at least not harder). Interestingly, there was a btn-xs
in BS4, but that, too, was dropped in BS5.
+1 for doing the first one. Seems to make more sense from a semantic perspective.
I finally got around to continue this transition (and re-learning css on the way), there is one thing I am struggling with:
Some "buttons" (which partly used to be badges) have the class btn-attachment
and badge-attachment
, but I cannot find the definition of the classes. @mbollmann do you know this?
I have pushed the current state. Known problems:
- attachment button not rendered correctly (see Q above)
- "more options" in the copy citations line is not working
- cite -> preformatted not working
The last two are probably JS related, as bootstrap has dropped jquery; I have not started working on the js changes yet. Please have a look whether there is anything else not working as intended or not looking good.
I finally got around to continue this transition (and re-learning css on the way), there is one thing I am struggling with: Some "buttons" (which partly used to be badges) have the class
btn-attachment
andbadge-attachment
, but I cannot find the definition of the classes. @mbollmann do you know this?
I think that used to be generated from the "attachment" theme color that's added in hugo/assets/css/main.scss
.
I'm completely swamped with work at the moment so it'll be a while until I can take a closer look at the changes.
Build successful. Some useful links:
- Complete site preview: https://preview.aclanthology.org/update-css-js
- Potential volumes of interest: 2005.mtsummit-invited, 2005.mtsummit-papers, 2005.mtsummit-posters, 2005.mtsummit-tutorials, 2005.mtsummit-osmtw, 2005.mtsummit-ebmt, 2005.mtsummit-wpt, 2005.mtsummit-swtmt, 2014.iwslt-keynotes, 2014.iwslt-evaluation, 2014.iwslt-papers, 2018.ijclclp-1, 2018.ijclclp-2, 2019.ijclclp-1, 2019.ijclclp-2, 2020.aacl-main, 2020.aacl-srw, 2020.aacl-demo, 2020.acl-main, 2020.acl-demos, 2020.acl-srw, 2020.acl-tutorials, 2020.blackboxnlp-1, 2020.coling-main, 2020.coling-demos, 2020.coling-tutorials, 2020.coling-industry, 2020.dmr-1, 2020.emnlp-main, 2020.emnlp-demos, 2020.emnlp-tutorials, 2020.figlang-1, 2020.findings-emnlp, 2020.ijclclp-1, 2020.ijclclp-2, 2020.lrec-1, 2020.nlp4convai-1, 2020.rocling-1, 2020.scai-1, 2020.spnlp-1, 2020.tacl-1, 2020.textgraphs-1, 2020.webnlg-1, 2021.acl-long, 2021.acl-short, 2021.acl-srw, 2021.acl-demo, 2021.acl-tutorials, 2021.adaptnlp-1, 2021.americasnlp-1, 2021.bionlp-1, 2021.blackboxnlp-1, 2021.ccl-1, 2021.conll-1, 2021.crac-1, 2021.dialdoc-1, 2021.eacl-main, 2021.eacl-demos, 2021.eacl-srw, 2021.eacl-tutorials, 2021.emnlp-main, 2021.emnlp-demo, 2021.emnlp-tutorials, 2021.findings-acl, 2021.findings-emnlp, 2021.iwpt-1, 2021.law-1, 2021.mrqa-1, 2021.naacl-main, 2021.naacl-demos, 2021.naacl-srw, 2021.naacl-tutorials, 2021.naacl-industry, 2021.nlp4convai-1, 2021.paclic-1, 2021.textgraphs-1, 2021.tlt-1, 2021.wmt-1, D15-1, D15-2, D16-1, D16-2, D17-1, D17-2, D17-3, D18-1, D18-2, D18-3, D19-1, D19-2, D19-3, D19-50, D19-51, D19-52, D19-53, D19-54, D19-55, D19-56, D19-57, D19-58, D19-59, D19-60, D19-61, D19-62, D19-63, D19-64, D19-65, D19-66, N04-1, N04-2, N04-3, N04-4, N16-1, N16-2, N16-3, N16-4, N18-1, N18-2, N18-3, N18-4, N18-5, N18-6, N19-1, N19-2, N19-3, N19-4, N19-5, P12-1, P12-2, P12-3, P12-4, P13-1, P13-2, P13-3, P13-4, P13-5, P15-1, P15-2, P15-3, P15-4, P15-5, P16-1, P16-2, P16-3, P16-4, P16-5, P18-1, P18-2, P18-3, P18-4, P18-5, P19-1, P19-2, P19-3, P19-4, S17-1, S17-2, S19-1, S19-2, W13-1, W13-2, W13-3, W13-4, W13-5, W13-6, W13-7, W13-8, W13-9, W13-10, W13-11, W13-12, W13-13, W13-14, W13-15, W13-16, W13-17, W13-18, W13-19, W13-20, W13-21, W13-22, W13-23, W13-24, W13-25, W13-26, W13-27, W13-28, W13-29, W13-30, W13-31, W13-32, W13-33, W13-34, W13-35, W13-36, W13-37, W13-38, W13-39, W13-40, W13-41, W13-42, W13-43, W13-44, W13-45, W13-46, W13-47, W13-48, W13-49, W13-50, W13-51, W13-52, W13-53, W13-54, W13-55, W13-56, W13-57, W15-1, W15-2, W15-3, W15-4, W15-5, W15-6, W15-7, W15-8, W15-9, W15-10, W15-11, W15-12, W15-13, W15-14, W15-15, W15-16, W15-17, W15-18, W15-19, W15-20, W15-21, W15-22, W15-23, W15-24, W15-25, W15-26, W15-27, W15-28, W15-29, W15-30, W15-31, W15-32, W15-33, W15-34, W15-35, W15-36, W15-37, W15-38, W15-39, W15-40, W15-41, W15-42, W15-43, W15-44, W15-45, W15-46, W15-47, W15-48, W15-49, W15-50, W15-51, W15-52, W15-53, W15-54, W15-55, W15-56, W15-57, W15-59, W16-1, W16-2, W16-3, W16-4, W16-5, W16-6, W16-7, W16-8, W16-9, W16-10, W16-11, W16-12, W16-13, W16-14, W16-15, W16-16, W16-17, W16-18, W16-19, W16-20, W16-21, W16-22, W16-23, W16-24, W16-25, W16-26, W16-27, W16-28, W16-29, W16-30, W16-31, W16-32, W16-33, W16-34, W16-35, W16-36, W16-37, W16-38, W16-39, W16-40, W16-41, W16-42, W16-43, W16-44, W16-45, W16-46, W16-47, W16-48, W16-49, W16-50, W16-51, W16-52, W16-53, W16-54, W16-55, W16-56, W16-57, W16-58, W16-59, W16-60, W16-61, W16-62, W16-63, W16-64, W16-65, W16-66, W17-1, W17-2, W17-3, W17-4, W17-5, W17-6, W17-7, W17-8, W17-9, W17-10, W17-11, W17-12, W17-13, W17-14, W17-15, W17-16, W17-17, W17-18, W17-19, W17-20, W17-22, W17-23, W17-24, W17-25, W17-26, W17-27, W17-28, W17-29, W17-30, W17-31, W17-32, W17-34, W17-35, W17-36, W17-37, W17-38, W17-39, W17-40, W17-41, W17-42, W17-43, W17-44, W17-45, W17-46, W17-47, W17-48, W17-49, W17-50, W17-51, W17-52, W17-53, W17-54, W17-55, W17-56, W17-57, W17-58, W17-59, W17-60, W17-62, W17-63, W17-65, W17-66, W17-68, W17-69, W17-70, W17-71, W17-72, W17-73, W17-74, W17-75, W17-76, W17-77, W17-78, W17-79, W17-80, W17-81, W19-1, W19-3, W19-4, W19-5, W19-6, W19-8, W19-9, W19-10, W19-11, W19-12, W19-13, W19-14, W19-15, W19-16, W19-17, W19-18, W19-19, W19-20, W19-21, W19-22, W19-23, W19-24, W19-25, W19-26, W19-27, W19-28, W19-29, W19-30, W19-31, W19-32, W19-33, W19-34, W19-35, W19-36, W19-37, W19-38, W19-39, W19-40, W19-41, W19-42, W19-43, W19-44, W19-45, W19-46, W19-47, W19-48, W19-49, W19-50, W19-51, W19-52, W19-53, W19-54, W19-55, W19-56, W19-57, W19-58, W19-59, W19-60, W19-61, W19-62, W19-63, W19-64, W19-65, W19-66, W19-67, W19-68, W19-69, W19-70, W19-71, W19-72, W19-73, W19-74, W19-75, W19-76, W19-77, W19-78, W19-79, W19-80, W19-81, W19-83, W19-84, W19-85, W19-86, W19-87, W19-89, W19-90
This preview will be removed when the branch is merged.
Thanks @mbollmann that was the hint I needed :-)
Everything should be fixed now, please have a look at the preview -- after it is built.
one thing to note: bootstrap 5 has changed the font handling a bit and you might find that the new version uses different fonts (it does on my system). Bootstrap always tried to use system fonts by default and how it does that has evolved a bit.
Thanks for picking this up! In Safari on a Mac, things do not look right:
-
Links are underlined, bad spacing on PDF button https://preview.aclanthology.org/update-css-js/2021.iwslt-1.1/
-
Main page not displaying info box correctly. Also no margins in the header (but maybe that's fine?)

Will look into underline & icon spacing (I have that as well, but here the lines are thinner so I did not notice ...)
Is the second image a forced narrow rendering or what is the context?
The new default font choice is ... surprising. On my system, it's remarkably different from how it used to look, and my first reaction is that I find it unpleasant:
I also never really noticed this big of a difference between systems with the current site (though I haven't explicitly tested it).
Also, I notice that the font color is now black on all the buttons, whereas before it used to be white on buttons with sufficiently dark background. I believe the old Bootstrap used to determine that automatically based on an SCSS function that determines color brightness or something. Does this need to be done explicitly now?
Ah, so the new Bootstrap defaults to whatever the user's system UI font is. That means it's completely unpredictable what the font will be for a given user, which I'm not sure I'm a big fan of from a branding perspective... At the very least, it seems this would make it harder to test layout changes & ensure they look good for everyone? I haven't looked into Bootstrap's rationale for this change, though.
The new default font should be closer to your system default, the old one you saw is still there as a fallback in case the correct one cannot be loaded. The rationale is unchanged, the method has just evolved. Edit: in other words: the font has not become less predictable; bootstrap 4 already tried to use the system font.
If I remember / understand the theming for the buttons correctly, they have black text on everything brighter than 50% and white on darker than 50%. I noticed that as well last year, looked into it and they had a reason to change it but I forgot what it was.
underline & icon spacing is now fixed.
On my desktop (MacBook Pro in Safari, all latest) I still see this on the main page:

unless I zoom way out:

Thanks! I will look at the scaling issue. Can reproduce when zooming in to 150%.
Links still underlined on list pages (volume/author pages).
I still feel strongly that the font should be set to something more predictable. At the risk of sounding like a grumpy old Linux user, the font I set for my system UI is very much not a font I'd like to see websites or documents in, as they serve very different purposes. That, plus all the other reasons I gave in my last comment. Still happy to be convinced otherwise; maybe I'm the only weirdo who will complain that the Anthology suddenly got a lot uglier.
We can use a custom font; all I wanted to say is that bootstrap 4 already tried to use a system font and the main difference for bootstrap 5 is that there is a new approach to find the system font, which may result in a different font being used now. There is no new feature or explicitly changed font here.
Wrapping for the landing page is updated, the header is not looking correct and the link underline for lists needs a look (this underline thing is a mess)
Do you have a font to propose? I tried computer modern for fun, but it is very dense.