Problem/Motivation
Bartik's code needs to meet current Drupal coding standards.
The current typography.css file does not meet with Drupal's CSS file organisation standards - see here.
Proposed resolution
The styles within the typography.css
file should be put into either elements.css if they are base element styles for Bartik or if they are specific to a component they are to moved into in the relevant component file they belong to.
Specific CSS cleanup tasks which should also be followed when cleaning up the CSS are outlined in #1342054: [META] Clean up templates and CSS.
Remaining tasks
- Write a patch
- Review the patch - code review and visual changes
- Upload screenshots to show nothing/something is broken on the frontend
User interface changes
None, we are cleaning up CSS and markup in templates. The use of Bartik's UI and design will stay the same.
API changes
n/a
Beta phase evaluation
Issue category | Task because it is a code clean up overhaul of a theme. |
---|---|
Unfrozen changes | Unfrozen because it only refactors CSS and templates, no changes to UI or APIs |
Prioritized changes | The main goal of this issue is usability and performance. We want Bartik code to be up to date and something to be proud of. |
Disruption | No disruption it's only refactoring code not changing how to use the theme |
Comment | File | Size | Author |
---|---|---|---|
#44 | after typography.css remove.png | 32.2 KB | emma.maria |
#44 | before typography.css remove.png | 34.54 KB | emma.maria |
#40 | 2398447-40.patch | 8.42 KB | idebr |
#13 | typography-2398447.patch | 6.2 KB | Maninders |
Comments
Comment #1
emma.mariaComment #2
emma.mariaComment #3
emma.mariaComment #4
zealfire CreditAttribution: zealfire commentedFrom what i could best understand from this link(https://www.drupal.org/node/1887922),i think putting content of typography file in element.css file would be fine idea.But since i am new to codebase of drupal will it be fine to make changes in file of element.css in this manner:
body{
previous content remains same only this is additionaly added:font-family: Georgia, "Times New Roman", Times, serif;
}
Fonts will be written under Reset styles
/*-----------Fonts-------------------*/
#site-slogan,
.site-slogan,
#page .ui-widget,
.comment-form label,
.node-form label,
.node-form .description {
font-family: Georgia, "Times New Roman", Times, serif;
}
Also i don't think there is any need of cleaning task i.e. what i have derived after reading this link https://www.drupal.org/node/1342054
Comment #5
DickJohnson CreditAttribution: DickJohnson commentedelements.css should not include things like .node-form label.
Also investigated this issue a bit. On Seven theme it looks like font-family is used per component at least in tabs.css and admin-options.css. So my guess is that body, input, select, textarea and button should be moved from typography.css to elements.css and split the rest of the stuff to component-files.
Comment #6
DickJohnson CreditAttribution: DickJohnson commentedPlayed around a bit with this and ended up with solution like this. Need to think a while what to do with rest of stuff.
Comment #7
alexpottI'm surprised the idea of splitting up of the typography.css and moving this into individual components. Reading https://www.drupal.org/node/1887922 - isn't font selection about look and feel?
Comment #8
LewisNymanWe actually don't split the styling for a component into separate files, it's important that the styling for a component is one file, so you can look in one place.
The theme category in SMACSS actually refers to global, page level changes. The example files given in the CSS standards are
theme--dark
andtheme--light
Maybe we need to update the wording of that category in the standards so it's more clear.
Comment #9
LewisNymanI think these selectors belong in form.css, buttons.css, and table.css
font-family is included by mistake
Comment #10
alexpottre #8 but typography is specifically mentioned on http://smacss.com/book/type-theme
Comment #11
LewisNymanYes, but the situation is different. The situation is when you want to change the font globally across the whole site in a specific context:
There isn't a situation in Bartik where we want to change the font wholesale, so the is no benefit of containing it within one file. I don't think we have a need for any theme files in Bartik and that's common with a lot of SMACSS projects.
Comment #12
Maninders CreditAttribution: Maninders commentedComment #13
Maninders CreditAttribution: Maninders commentedWorked on the LewisNyman comment. typography-2398447.patch
Comment #14
Maninders CreditAttribution: Maninders commentedI posted interdiff-2398447-6-13.txt
Comment #15
lauriiiWe dont have to create new selector here because there is already existing selector for this
Comment #16
Maninders CreditAttribution: Maninders commentedThnx lauriii, for the reply. And i make a selector like button type="submit" not a class, so please test it again. If it's worked then its fine otherwise i will changed it.
Comment #17
Maninders CreditAttribution: Maninders commentedComment #18
emma.mariaComment #19
LewisNymanWe only need one blank line here
The site slogan seems to be missing the font declaration now
This one is missing also
And these
These need to be moved into the correct files still.
.contextual-links -> Contextual.css
.links -> content.css
.primary -> tabs.css
This one has not been moved
Can we move these lines down so they are above the input, textarea, and select styling?
Comment #22
rootwork#13 wasn't applying anymore, so I rerolled. I also tried to address all of the issues from #15 and #19.
Notes:
a
element.Comment #23
ramkrk CreditAttribution: ramkrk commented#22, i have been check out and applied your patch file. I found an issue that the pages been shirnked and some text has collapsed in their size. There is slight jerk on all pages before and after the patch: the Site title becomes bigger. To correct this requires font size and type to be defined separately.
font: 87.5% Georgia, "Times New Roman", Times, serif; - this should be an issue. Checked with chromium Version 37.0.2062.120.
Comment #24
ramkrk CreditAttribution: ramkrk commentedHere is the updated patch.
Comment #25
ramkrk CreditAttribution: ramkrk commentedComment #26
ramkrk CreditAttribution: ramkrk commentedIgnore #24. Here is the updated patch.
Comment #27
LewisNymanGreat! We are just missing one thing.
We are missing this selector
Comment #28
DickJohnson CreditAttribution: DickJohnson commentedTried to figure out if we're calling that at all, but I'm not sure about it. Couldn't really find it anywhere.
Comment #29
rootworkMy bad, I had added .ui-widget instead of #page .ui-widget.
#page doesn't exist anywhere other than the layout.css file (which seemed an inappropriate place to put this definition) so I put it at the end of content.css with other page-related things. It may make more sense somewhere else, though; I'm not sure exactly how it's being used.
Comment #30
LewisNymanAh that's why I missed it. In this case, let's just play it safe and figure out how and where it's being used in #2398463: Clean up the "content" component in Bartik
RTBC!
Comment #32
emma.mariaComment #33
emma.mariaPatch rerolled. I diffed my patch with the previous one in #29 and found no changes.
Can someone please put this back to RTBC if they so no problems from the reroll.
Comment #34
LewisNymanLooks good!
Comment #35
idebr CreditAttribution: idebr commentedThis comment is no longer relevant now that #2408653: Remove lists.css from Bartik, add it's current code directly to the components it references. has been committed
Comment #36
emma.mariaComment #37
emma.maria#35 is not related to this issue but as it was left behind as part of another issue and it's a small thing I will add it to the patch.
Comment #38
idebr CreditAttribution: idebr commentedAlright, look good. Thanks, emma.maria! :)
Comment #40
idebr CreditAttribution: idebr commentedReroll after #2402639: Rename the footer regions in Bartik was committed.
Comment #41
rootworkLooks like a solid reroll to me.
Comment #42
alexpottNow we are removing typography.css we need a place to document the font stack a theme uses... so people like me know how to check whether a change is correct. The same for media queries #2399709: Remove media.css from Bartik, add it's current code directly to the components it references.. But like that patch I'm not going to hold this up on that. But can someone please up an issue to address this.
Committed 82fa1a6 and pushed to 8.0.x. Thanks!
Thanks for adding the beta evaluation to the issue summary.
Comment #44
emma.mariaThis issue caused a small CSS regression in Core.
Before:
After:
I have raised a new issue as I also found that another issue also added a small regression, I have combined the work into this issue... #2422975: Bartik footer has CSS regressions..
PLEASE PLEASE PLEASE add screenshots and manually test Bartik before setting these CSS cleanup issues to RTBC.