-
-
Notifications
You must be signed in to change notification settings - Fork 559
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
XWIKI-10871: Misalignments in the class editor on mobile #3885
Open
tkrieck
wants to merge
3
commits into
xwiki:master
Choose a base branch
from
tkrieck:XWIKI-10871
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Wouldn't it be sufficient to target this element with the existing ID attribute? Other CSS rules in the same file targeting the same element use this ID, too. Or is there any reason to prefer using classes? If we introduce a new class, I would prefer to follow our naming conventions with
add-xproperty
.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.
I'd leave IDs for JS reference only, or as much as possible. My reason is that, while it's possible to target it with CSS, the specificities of IDs are higher than classes. See: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_cascade/Specificity
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.
Is this a commonly used pattern to not use IDs in CSS? I'm asking because in XWiki, I think we're currently not following this pattern. So maybe there should be a proposal to add this to our code style? To me, it seems quite inconsistent to have a CSS file with selectors for both the ID and the class that are both only on a single element. I'm not asking to completely change them, but to me the only good reason to have this inconsistency and not use the ID as in the rest of the CSS would be that we say that IDs shouldn't be used in CSS, and therefore we migrate our code to the new style whenever we touch 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.
It's very common, the lower the specificity of each CSS rule means that overwriting it will be easier for different cases like hovering, disabling for example. Also, there's better portability (defining one rule and using it across many different places).
You have a good point here. If you think it's more coherent, I'll port this implementation to use the ID, but open a proposal to change the code style. What do you think?
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.
I'm fine with either using the ID or introducing a new class (but preferably using kebab-case, so
add-xproperty
), but for the second option there would need to be a proposal to add this to the code style. You could open the proposal, and then we wait a few days, and if nobody objects, the PR can be merged.