seneqa
16 November 2024 09:21
1
Operating system
Windows
Joplin version
3.2.1
What issue do you have?
Hello! I used the code in userchrome.css to:
editor and viewer swapped
viewer was bigger than editor
Code:
'''
.rli-editor > div > div > div > div > div > div > div:nth-child(1) {
flex: 1 0 0% !important;
}
.rli-editor > div > div > div > div > div > div > div:nth-child(2) {
flex: 2.2 1 0% !important;
border-left: none !important;
}
.editor-toolbar {
max-width: 100% !important;
}
.rli-editor > div > div > div > div > div > div {
flex-direction: row-reverse !important;
}
'''
But after the update it doesn't work. What should I fix in the code to make it work?
seneqa
16 November 2024 10:11
2
Okay, I figured it out myself. Maybe it will be useful to someone:
#react-root > div.profile-default > div > div.resizableLayoutItem.rli-root > div.resizableLayoutItem.rli-editor > div > div > div > div > div:nth-child(2) > div > div:nth-child(2) > div:nth-child(1) {
flex: 1 0 0% !important;
}
#react-root > div.profile-default > div > div.resizableLayoutItem.rli-root > div.resizableLayoutItem.rli-editor > div > div > div > div > div:nth-child(2) > div > div:nth-child(2) > div:nth-child(2) {
flex: 2.2 1 0% !important;
border-left: none !important;
}
#react-root > div.profile-default > div > div.resizableLayoutItem.rli-root > div.resizableLayoutItem.rli-editor > div > div > div > div > div:nth-child(2) > div > div:nth-child(2) {
flex-direction: row-reverse !important;
}
1 Like
I'm linking to a related pull request that should make the editor/viewer easier to style:
laurent22:dev
← personalizedrefrigerator:pr/desktop/editor-wrapper/prefer-css-to-style
opened 05:55AM - 20 Nov 24 UTC
# Summary
This pull request migrates part of the Markdown editor's styling fr… om `style=`-based styling to SCSS.
**Motivation**: This is motivated in part by the large string of `> div > div > ...`s posted as a solution to [this post on the forum](https://discourse.joplinapp.org/t/the-style-in-userchrome-css-stopped-working-as-it-should/41978/2). Such style sheets are likely to be fragile to changes to the app's structure in the future.
# Screenshots
## CodeMirror 6-based editor
![Screenshot: editor and viewer side-by-side](https://github.com/user-attachments/assets/b4537284-d1d4-4e08-a8e5-b736546e4fc7)
![Screenshot: editor only](https://github.com/user-attachments/assets/2f59657e-8feb-49c4-8a33-7f192b73cc0a)
![Screenshot: viewer only](https://github.com/user-attachments/assets/dda19dbc-bb68-4335-8436-dd78c0ef1ef3)
## Legacy editor (CodeMirror 5-based)
![Screenshot editor and viewer side-by-side](https://github.com/user-attachments/assets/71ecf94e-cf9e-4b07-82e8-614192ae5009)
![Screenshot editor only](https://github.com/user-attachments/assets/7943d11f-fcb3-4e01-b13e-ea02b720ad5c)
![Screenshot viewer only](https://github.com/user-attachments/assets/534d3f8d-4442-438f-8891-674311119767)