Needs review
Project:
Quick Edit
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Jan 2015 at 13:41 UTC
Updated:
19 Jun 2023 at 16:05 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lewisnymanComment #2
lewisnymanComment #3
manjit.singh@lewis Please verify the patch. There was minor space that needs to remove.
Comment #4
lewisnymanI went over the quickedit CSS files and found more problems to fix, see What to look for when reviewing CSS
.quickedit-icon
.quickedit-icon--only
.quickedit-icon--end
Maybe we can remove this selector and move the this font size property up into the .quickedit-icon selector? Let's find out which selector it's overriding
.quickedit-icon--pencil
.quickedit-icon--close
Can we move these image properties up into the selectors above? We can delete this comment.
.quickedit-icon--throbber
.quickedit-icon--pencil
.quickedit-validation-errors__messages--error
This should be a class, with a hyphen instead of an underscore
.quickedit-form__placeholder
.quickedit-toolbar__container
.quickedit-toolbar__pointer
.quickedit-toolbar__lining
.quickedit-toolgroup--ops
I'm not sure what this classes is for, maybe it needs a more description name?
This should be a class
We should be able to reduce this selector to .quickedit-editable
The same with these, we should be able to just use .quickedit-highlighted
The same with these as well
.quickedit-editor.is-popup
.quickedit-toolbar__container
.quickedit-toolbar__content
.quickedit-toolbar__pointer
.quickedit-toolbar__label
We are using an odd font-family, is this supposed to match the Seven theme? In that case it should be
"Lucida Grande", "Lucida Sans Unicode", "DejaVu Sans", "Lucida Sans", sans-serif.quickedit-toolbar__entity
Comment #5
maninders commentedComment #6
maninders commentedI have changed the classes as per #4 suggestions.
Comment #7
RavindraSingh commented@Maninder, When you are making a change in CSS. I believe this reflects somewhere definitely. So this would be good to add screenshot too to show the output after making change.
Comment #8
lewisnymanIt looks like we've changed the CSS, but we haven't changed the markup to match the new classes. The CSS will no longer apply.
Comment #9
lewisnymanIt looks like a lot of the classes are applied in Javascript. For example: /core/modules/quickedit/js/views/EntityToolbarView.js
Comment #10
mathieuspil commentedComment #11
mathieuspil commented1) Should we still be using clearfix?
2) I changed
this.show('ops');bythis.show('quickedit-toolgroup--ops');But I have no clue what it does.3) Should we create a follow-up ticket for all the html that gets defined in js, or is this intentional?
4) Removed
Because I don't think this is used anywhere.
5) Created a first patch so all the classes are now smacss'ed, without changing the css-specificity. This way we can really test this patch so we are sure we don't oversee anything. After someone confirmes that this patch looks like it isn't breaking anything. we start refactoring the css further (without changing all the class-names at once)
6) It seems to me that a lot of js is a bit too complex. (More logical classes now show this, so lets setup a ticket for refactoring after this one is finished)
7) I am also not convinced of the
--onlymodifier, can we use --solo or --no-extra or something?Comment #12
droplet commentedwhy don't remove qualified `.quickedit` ?
Comment #13
mathieuspil commentedYes, we will need to refactor a whole lot of the css itself.
But first I want to have confirmation all the classes are ok before we start refactoring?
Comment #14
lewisnymanOk cool, I'm happy with prefixing the icon classes with quickedit as they appear on the frontend of sites.
Yeah clearfix is fine.
Sounds like a follow up
I can't test this patch because it needs a reroll :( Sorry
Comment #15
lewisnymanOk cool, I'm happy with prefixing the icon classes with quickedit as they appear on the frontend of sites.
Yeah clearfix is fine.
Sounds like a follow up
I can't test this patch because it needs a reroll :( Sorry
Comment #16
manjit.singhrerolling a patch.
Comment #17
manjit.singhComment #18
lewisnymanI manually tested the patch and it looks the same as before. I think we can progress with simplifying the CSS now.
Can we remove all the .quickedit classes from the selectors? Ideally we only want one class per selector. I know that's not possible everywhere.
Quickedit-toolgroup should be removed
We can remove quickedit-toolbar__container
We we can remove .quickedit-button
Comment #19
lewisnymanCSSlint also says there are quite a few properties with 0px instead of 0
Comment #20
cchanana commentedComment #21
cchanana commentedChanges has been implemented as per @LewisNyman comment in #18
Comment #22
cchanana commentedComment #23
droplet commentedThere's many CSS code in this way:
but I think both BEM & SMACSS are trying to avoid these, and convert them into following way as possible as it can be:
Also, following pattern looks totally wrong:
WORSE:
.quickedit-toolbar__container.quickedit-toolbar__pointer--top > .quickedit-toolbar__pointerBAD:
.quickedit-toolbar__pointer--top > .quickedit-toolbar__pointerOK:
.quickedit-toolbar__pointer--top >.quickedit-toolbar__pointer--topComment #24
lewisnymanYeah if we can reduce them all to single selectors in this issue we should try, but only if we are sure we won't cause regressions.
Comment #25
manjit.singh@lewis Which all selectors, Is it only related to quickedit or other ?
Comment #26
lewisnyman@Manjit.Singh We are only focusing on quickedit markup and CSS in this issue
Comment #27
Aleksandar_P commentedComment #28
Aleksandar_P commentedUsing a patch from comment #16, I have removed unnecessary classes. The ones that stayed, are the one that are needed for overriding default styles.
I have removed two pieces of code from `quickedit.theme.css` due to their unnecessity. Much of the selectors needed additional classes to override these codes that don't style anything, so I eliminated them.
This code was styling nothing but was making `.quickedit-highlighted` impossible to use without `.quickedit-form` in front of it. Every `.quickedit-form` has `.quickedit-highlighted`.
Same problem here. Every button has its more specific BEM class `.quickedit-button--save` and `.quickedit-button--cancel`. It was not possible to style these two elements without `.quickedit-button` before the specific class.
Comment #29
lewisnymanGreat, nice work here. I manually tested the patch and there are no visual regressions.
One or two things I picked up from the CSSlint tool:
Negative text-indent doesn't work well with RTL. If you use text-indent for image replacement explicitly set direction for that item to ltr.
This doesn't seem to have an effect, I think normalise CSS handles this kind of inconsistencies.
Duplicate property 'max-width' found.
If we switch the attribute selector around with the class it would be faster. So: [aria-hidden="true"].quickedit-button
Why are these commented out? Can we just remove them?
Outlines shouldn't be hidden unless other visual changes are made. If we don't have a good reason for disabling it maybe we could just remove this?
Comment #30
Aleksandar_P commentedComment #31
Aleksandar_P commentedI have changed some of the things mentioned above, however
Negative text indent works fine for RTL and positive does not.
Outline none is necessary because there is some dark blue border which is overridden with
Now, I moved the outline removing to the `quickedit.theme.css` to the same place where the box-shadow is defined.
Comment #32
mathieuspil commentedUnassigning for review ;)
Comment #33
ntucakovic commentedSo I've just started reviewing the code and found something I'm not sure what to think about.
There are classes prefixed with 'animate-' which is quite generic and might interfere with further module development or some other modules. There also a class 'animate-only-visibility', 'animate-disable-width' etc, which I think shouldn't be called so generic. I think we should prefix with module name before animate because that's not something that should be used outside the scope of the module.
Although, it should be reusable, which I'm not sure how we can achieve. New CSS file with bunch of combinations regarding animation? I don't think so...
Update: Just discussed with couple of folk at Drupalcon, I'll edit .animate to be a modifier to .quickedit-toolgroup because essentially that's how it's used now.
Comment #34
ntucakovic commentedWhat I've found with latest patch is described above in #33, so it needs a new review. This is my first patch so let me know if I didn't follow some convention properly :) thanks
Comment #35
ntucakovic commentedChanged to unassigned for review
Comment #36
mathieuspil commentedOk, we need feedback on the changes in #31 AND review on #34.
Comment #37
lewisnymanWe should always set direction to LTR when using negative text indent, see the information here: https://github.com/CSSLint/csslint/wiki/disallow-negative-text-indent
I looked at this and it seems that this isn't used? The elements that have this class applied are divs, so I don't think they will ever receive focus.
I ran through the patch, made these changes and reformatted the single line comments to match our standards. We just need a few screenshots to show we haven't broken anything. This is a novice task.
Comment #45
vg3095 commentedPatch needs re-roll
Comment #46
kostyashupenkoReroll of #37
Comment #47
manjit.singhIt would be move into 8.2.x
Comment #48
magi.yv commentedComment #49
magi.yv commentedComment #50
magi.yv commentedPatch #46 is working fine on 8.2.x. Can anyone confirm it ?
Comment #51
manjit.singhSo now we need the screenshots (before/after) that Quickedit is working fine after applying the latest patch.
Comment #52
maninders commentedComment #53
droplet commentedwhy `.quickedit` here
why use `.quickedit-toolbar` & `quickedit-toolbar__*` at same time?
Comment #54
maninders commented@droplet I just remove the quickedit classes as mentioned in #53.
Please review the patch.
Comment #56
wim leers#37 is >20K. This is 1.5 K. That makes no sense. It sounds like something went wrong.
Comment #57
emma.maria#54 has lost a lot of what was in #46.
#46 somehow still applies to 8.3.x so it can be reviewed :-)
Comment #58
wim leersThanks, @emma.maria!
This should be committed after #2828528: Add Quick Edit Functional JS test coverage, to ensure this does not break Quick Edit.
But, the review process can continue in the mean time :) Does this need a review from me (component maintainer), or from a CSS maintainer?
Comment #61
Andrusha commentedComment #62
Andrusha commentedComment #64
anavarre#2828528: Add Quick Edit Functional JS test coverage is in.
Comment #66
nesstheheroGood afternoon.
I wanted to chime in on this as a fly on the wall, non-contributor, without creating a separate ticket as this one seems the most appropriate and still in progress.
Some feedback about the quickedit css. Could some kind of namespace be added to the .icon class names?
At my company we do a couple of Drupal 8 sites and we also frequently use Icomoon. Icomoon generates some CSS with .icon as the chosen classname, with .icon-{NAME} as each icon's name. The default CSS that Icomoon provides causes some wonky issues with the quickedit panel that appears when inline editing a text or WYSIWYG field.
Obviously I could just change it on my end to reduce clashing, but I feel like .icon is just a generic class name that having it as part of the application seems asking for conflict. Adding a generic namespace like .qe- to the beginning of each class would probably be sufficient.
Again, just some 2 cents. I have a feeling .icon is an existing class you are tying into the functionality of and might be a bigger change than what I'm asking.
Thank you for your time.
Comment #71
zrpnrSome good, thoughtful work in this thread! It would be great to see this get picked up again and have these updates in Quickedit, as well as the broader parent issue #1995272: [Meta] Refactor module CSS files inline with our CSS standards
The patch in #46 no longer applies, (no surprise after 4 years!)
and does need the changes from #54 merged in.
Comment #72
anushrikumari commentedComment #73
atul4drupal commented@anushrikumari We appreciate your effort in helping resolve the issues and making Drupal experience better. We also need to be more concerned about other contributors by not blocking the issue by assigning it to our self, as this practice is generally discouraged @here and even if you are assigning, it helps to mention by when a response is expected from you.
At this point I see you have 2 issues assigned to yourself: this one and the other is 3181778 both tagged as novice and for re-roll.
We preferably should avoid such assignment of issues.
Comment #74
anushrikumari commented@atul4drupal I've created the patch but was getting failure, that's why it was delayed. Thanks for the suggestion I'll try to avoid that.
Comment #75
adityasingh commentedFixed #74 Custom Commands Failed. Kindly review the patch.
Comment #79
spokjeDue to Quickedit being moved out of Drupal Core and into a Contrib Module, moving this issue to the Contrib Module queue.
Comment #80
amin.ankitHi, I'll work on this issue.
Thanks,
Comment #81
amin.ankitComment #82
ravi kant commentedI got messages "This module has deprecated" during enabling QuickEdit module.
Are we still contributing this module?