Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

[Feature Request] Custom number of visible lines/spoiler button for collapsed dictionaries #2168

Closed
aiko-tanaka opened this issue May 30, 2022 · 3 comments · Fixed by #2170
Closed

Comments

@aiko-tanaka
Copy link

aiko-tanaka commented May 30, 2022

Collapsible dictionaries (Appearance > Configure Collapsible dictionaries) allows users to have dictionaries collapsed/fully expanded by default.

Seems like the default number of lines visible for collapsed dicts is something around 3 lines. It'd be nice though if that number could be customizable per dict.

For example, i have 旺文社 as my main dictionary and i usually only look at its first 6 lines or so before moving on so I'd like to have its first 6 lines visible by default even when collapsed. Then I might have the other dictionaries like 大辞林 have only 2-3 lines by default. Would also be useful for ppl like me trying to get used to monolingual defs as we can fully hide bilingual dictionaries like JMDict (i.e. all contents hidden I assume if @ 0 lines visible) and the contents will only show when clicking the expand button, kinda acting like a spoiler button.

Thanks!

@toasted-nutbread
Copy link
Collaborator

You can do this with custom CSS:

.definition-item[data-dictionary='JMdict'] {
  --collapsible-definition-line-count: 2;
}

You can change JMdict to whatever your dictionary name is, and 2 to the line count.

@aiko-tanaka
Copy link
Author

aiko-tanaka commented May 30, 2022

This is so awesome!! thanks!

\
\

I guess what's left is something like a spoiler button for dicts like JMDict(English) and Kireicake? I have the line count set to 1 here. (setting line count to 0 removes the dictionary completely)

新和英 with line count set to 1:

I'm already pretty much 99% satisfied with this, but the 'spoiler' button might be worth looking into if you have the time I guess.

@aiko-tanaka aiko-tanaka changed the title [Feature Request] Custom number of visible lines for collapsed dictionaries [Feature Request] Custom number of visible lines/spoiler button for collapsed dictionaries May 30, 2022
@toasted-nutbread
Copy link
Collaborator

#2170 adds new options to force the expansion button to always be visible. Together with some more custom CSS, these options can be used to implement a basic spoiler functionality:

/* Spoiler-like functionality, use with Force collapsed mode */
.definition-item[data-dictionary='JMdict'] .definition-item-inner.collapsible.collapsed {
    color: #000000;
    background-color: #000000;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants