Closed jcoyne closed 2 years ago
last time i looked, all of the pure css solutions still required knowing the number of lines beforehand. it looks like we don't know that: https://github.com/projectblacklight/arclight/blob/809c34b30505145b5c12260ee0e3e1f9290ae273/vendor/assets/javascripts/responsiveTruncator.js#L25
if there is (finally!) a good solution that avoids that problem, I'd love to learn it!
Question after discussing with @thatbudakguy: can we set the number of lines in stone based on the best UI, and dictate that to CSS line clamp? Would involve consulting with Gary on UI.
also for reference: marlo implemented a mixin to do this on DLME using the -webkit-line-clamp
strategy, which works provided we know the desired number of lines to clamp to beforehand.
need to figure out how it interacts with the show/hide button, though.
@thatbudakguy we currently clamp everything here to 3 lines: https://github.com/projectblacklight/arclight/blob/main/app/assets/javascripts/arclight/responsiveTruncator.js#L18
Is that what you were asking?
oh — yep, it is. if it's always 3, that makes it easy!
https://css-tricks.com/line-clampin/