Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
See: #1995272: [Meta] Refactor module CSS files inline with our CSS standards
Remaining tasks
Review the current CSS — What to look for when reviewing CSS
User interface changes
None
API changes
None
Beta phase evaluation
Issue category | Task because coding standards |
---|---|
Issue priority | Not critical because coding standards |
Unfrozen changes | Unfrozen because it only changes markup |
Comment | File | Size | Author |
---|---|---|---|
#22 | Screen Shot 2015-06-12 at 09.50.00.jpg | 551.13 KB | LewisNyman |
#22 | Screen Shot 2015-06-12 at 09.49.47.jpg | 419.72 KB | LewisNyman |
#21 | refactor-entity-reference-css-2408463-21.patch | 4.01 KB | thomasfava |
#12 | refactor-entity-reference-css-2408463-12.patch | 7.82 KB | MathieuSpil |
#9 | interdiff-2408463-4-8.txt | 1.94 KB | Manjit.Singh |
Comments
Comment #1
LewisNymanComment #2
LewisNymanComment #3
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedKicking off this issue:
Fixes the only CSSlint-error. (unqualified-attributes)
Changed the
.entity-meta-header
-selector by the.entity-meta__header
-selector. => should we keep theentity-meta
start of the selector?Changed the
.entity-meta-header .published
-selector by the.entity-meta__header__title
-selector. => readabilityWith the same logic, I also changed
.entity-meta-header .changed
with.entity-meta__header__last-saved
again for readability.Should we refactor this selector:
.entity-meta details
into something like.entity-meta__panel
? (for me thedetails
-selector is the equivalent of thediv
-selector and therefor should we avoid using it?)Is there a reason why on /admin/structure/block we don't use the
.entity-meta
-selector as a parent of the.entity-meta-header
-selector?Comment #4
Manjit.Singh@MathieuSpil One thing i have noticed here is when details are not opened then there is no border for first-child, Please find screenshots for more clarity.
Comment #5
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedAdded interdiff for readability.
Comment #6
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedCan someone give us more context to where this
entity-meta
-wrapper can be found:Semantics are a tiny bit different from
node/1/edit and admin/structure/block. Are there any more places where this is being used? The solution in #4 fixes a issue on the blocks page, but it is a mere coincidence that it doesn't break the node-edit page. How should this be approached?
Comment #7
LewisNymanNice, I ran this through CSSlint and the error is fixed. Also here is screenshot showing that there are no regressions.
I think those are the only two places these are being used. See #2375663: Update the design for the right sidebar on content creation page
Can we rename this selector so we use a class like
entity-meta__content
instead of the details element?I think this can be
entity-meta__title
as wellI think we can simplify this class a little to just
entity-meta__last-saved
because we don't need to reflect the html structure in the CSS classesComment #8
Vidushi Mehta CreditAttribution: Vidushi Mehta commented@LewisNyman i have changed the classes but bit confused about entity-meta details[open] + details[open] .Should we also rename this to the given class?
Comment #9
Manjit.Singhuploading interdiff just for clarification what @vidushi did in #8.
Comment #11
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedHey Vidushi,
I see that in your patch(#8), you tried to fix the review of Lewis in (#7), which is great!
But if you change a css-selector, you should doublecheck that de html-output will also contain this class, so the new css will apply. (and vice versa)
Comment #12
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commented@Lewis: I am agreeing on the fact that the
.entity-meta details
-selector should become.entity-meta__details
for css-readability purposes and smacss, but in this context this will become unmaintainable. Some modules will hook into this and add multiple options. and the logic of defining the classes for these details elements is module-specific. So the question becomes: 'Do module-builders have to know that they should add the.entity-meta__details
to their details element?' If not, I wouldn't change it. Also the following css shouldn't no longer be very logical:Because the open-attribute is only appended on detail-elements.
In short: The patch (based upon #4) for clarity's sake, shows what that change would imply for modules (But we shouldn't be working further upon this. ). Suggestion 2&3 from #7 should still be implemented after this.
Comment #13
LewisNyman@Mathieu That makes sense, but I think that over time this component will become more generic and more reuseable, and module developers will only need to pass through the template file. They wouldn't need to add the class manually. With that in mind, which approach do you think is more maintainable? I would be nice to keep all the selectors as week as possible.
Comment #14
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedI would say that we can't use a good generic classname untill we provide a template file. So basically we can only use good css-classes if those do not become a problem to the module-developer.
So to summarize the open TODO's for this ticket since the patch in #4
1) Choose between keeping
.entity-meta details
(#4) and refactoring existing code to.entity-meta__details
(#12). (For the pro's and con's you can read the earlier comments)2) Replace the
entity-meta__header__title
-selector with theentity-meta__title
-selector.3) Replace the
entity-meta__header__last-saved
-selector with theentity-meta__last-saved
-selector.Comment #15
MathieuSpil CreditAttribution: MathieuSpil as a volunteer commentedComment #16
thomasfavaComment #17
thomasfavaI did points 2 & 3 from #14 (replaced the
entity-meta__header__title
-selector with theentity-meta__title
-selector and replaced theentity-meta__header__last-saved
-selector with theentity-meta__last-saved
-selector).Point 1 is still open.
Comment #18
thomasfavaComment #19
LewisNymanI approve of these changes! This looks good. One small thing
We always use leading 0s in our decimal numbers
Comment #20
thomasfavaComment #21
thomasfavaAdded leading 0s in decimal numbers.
Keep in mind point 1) from comment #14 is still open.
(Choose between keeping .entity-meta details #4 and refactoring existing code to .entity-meta__details #12.)
Comment #22
LewisNymanOk thanks, on reflection I think that we've done enough in this issue. There are other issues like #2375663: Update the design for the right sidebar on content creation page that can make this component to become more reuseable and make more sense as a component.
I ran this through CSSlint and it returned no errors.
Screenshots:
Note that there are no screenshots from Stark/Classy/Bartik because there is no entity meta styling anywhere except Seven.
Comment #23
alexpottManually tested and I could not spot any regression. Committed 53c197a and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Comment #26
Vidushi Mehta CreditAttribution: Vidushi Mehta as a volunteer and at gai Technologies Pvt Ltd for gai Technologies Pvt Ltd commented