-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[FIX] odoo_theme: add bottom margin to inner lists #7515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d195a1a to
466653e
Compare
Brieuc-brd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey 👋
So the issue this PR is addressing is the lack of bottom margin on the last
tag in a .simple list.
There is indeed a lack of bottom margin for .simple lists, but to solve this, you don't have to apply the margins on the last p. You can target a simpler selector that will be much easier to maintain 😉 (comments below).
466653e to
ecf4ea0
Compare
|
Hi @Brieuc-brd, thanks again for your insightful review! I agree I do not need to use such a complex selector, my reasoning for doing so was to replace this ⬇️ existing rule to have a single (although more complex) rule: However, if I leave this ⬆️ existing rule, and add the simple selector you suggested, the styles works as intended! Please take a look at the Files Changed tab on this PR to see the placement of the rule. I also removed two rules that were removing the Thank you for your insight here! 🙂 |
| ol.simple p, | ||
| ul.simple p { | ||
| margin-bottom: 0; | ||
| } | ||
|
|
||
| li > .simple { | ||
| margin-bottom: 1em; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could go further, I'd use .simple as the main selector and use the power of SCSS 🙂
.simple {
p {
margin-bottom: 0;
}
li > & {
margin-bottom: 1em;
}
}But, again, is the simple class used on other elements than ul & ol ? @AntoineVDV maybe you know it? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Brieuc-brd .simple is also used on dl elements. This SCSS works well for the dl element too.
I searched through the documentation and did not find any other instances of where the class .simple is used on other elements. This docutils Examples of Syntax Constructs document also only shows the class being used on only the ul, ol, and dl elements.
The dl, dt, and dd elements are heavily used on the applications/finance/accounting/get_started/cheat_sheet.rst doc for example.
I will push up a commit to update the CSS to SCSS since it is a more elegant solution 👍
ecf4ea0 to
287d5fa
Compare
Brieuc-brd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
AntoineVDV
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Brieuc-brd for reviewing :)
This also adds a margin to nested lists that are the last list item of the parent list, but I think that it's okay.
Could you just change the commit message to something more Odooesque? For example [FIX] odoo_theme: add bottom margin to inner lists
@robodoo delegate+
287d5fa to
38dcb52
Compare
closes #7515 Signed-off-by: Samuel Lieber (sali) <sali@odoo.com>
This PR fixes "simple" bullet list spacing within a non-simple list.
This issue was discovered in #7301 (comment)
This PR is addressing is the lack of bottom margin on the last
<p>tag in a .simple list.