Skip to content
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

Header scss optimisation #3050

Merged
merged 2 commits into from
Jan 19, 2017
Merged

Header scss optimisation #3050

merged 2 commits into from
Jan 19, 2017

Conversation

skjnldsv
Copy link
Member

Optimisation and simplification of the header.scss file

@nextcloud/designers

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added 3. to review Waiting for reviews design Design, UI, UX, etc. feature: scss labels Jan 12, 2017
@skjnldsv skjnldsv added this to the Nextcloud 12.0 milestone Jan 12, 2017
@skjnldsv skjnldsv self-assigned this Jan 12, 2017
@@ -1,3 +1,10 @@
/**
* @copyright Copyright (c) 2017, John Molakvoæ (skjnldsv@protonmail.com)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to include the original authors of the original file ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included the most active ones.
There is 16, should I include all of them? Or should we remove the copyright header entirely?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not about most active ones: it's about actual contributors to this file

* @license GNU AGPL version 3 or any later version
*
*/

/* prevent ugly selection effect on accidental selection */

#header, #navigation, #expanddiv {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-style wise these should be on separate lines, one per selector.

@@ -25,7 +32,6 @@
}

/* HEADERS ------------------------------------------------------------------ */

#body-user #header, #body-settings #header, #body-public #header {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, separate lines per selector for readability please. :)

@@ -39,7 +45,6 @@
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if you want to do this in the right way, please don't use "magical" values you should assign variables like this to z-index.
screen shot 2017-01-12 at 16 42 15

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variables will come after @Espina2
Please see the main scss pr!

margin-top: -21px;
padding: 0;
vertical-align: middle;
}
}

/* hover effect for app switcher label */
Copy link
Contributor

@Espina2 Espina2 Jan 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In here instead of repeating the code you why you don't use @extend?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you wish to extend exactly? There isn't that much similarity.

And extend is great amongst similar properties, but since we generate the css, we need to aim for a balance between readability and optimisation.

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@@ -1,20 +1,23 @@
/**
* @copyright Copyright (c) 2017, John Molakvoæ (skjnldsv@protonmail.com)
* @copyright Copyright (c) 2016, Lukas Reschke (lukas@statuscode.ch)
* @copyright Copyright (c) 2016, Julius Härtl (jus@bitgrid.net)
* @copyright Copyright (c) 2016, Jos Poortvliet (jospoortvliet@gmail.com)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skjnldsv I wrote the original file in 2014, that’s what I meant ;)
https://github.com/nextcloud/server/blame/stable11/core/css/header.css

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a script to output the original copyrights from the commits.
I will create a special pr to put all the copyrights correctly :)

@skjnldsv skjnldsv dismissed jancborchardt’s stale review January 17, 2017 08:51

Can you review the css only? I will update all the copyrights on a different pr :)

@jancborchardt
Copy link
Member

By the way, this might conflict with #2924 by @ChristophWurst depending on what work is done further. Could you coordinate here @ChristophWurst @skjnldsv, maybe merging this one into #2924?

@skjnldsv
Copy link
Member Author

@jancborchardt We should merge this one first since #2924 doesn't modify header.scss as much as this pr :)

@codecov-io
Copy link

Current coverage is 53.99% (diff: 100%)

Merging #3050 into master will increase coverage by 0.07%

@@             master      #3050   diff @@
==========================================
  Files          1302       1302          
  Lines         80061      80766   +705   
  Methods        7902       8006   +104   
  Messages          0          0          
  Branches       1245       1303    +58   
==========================================
+ Hits          43170      43611   +441   
- Misses        36891      37154   +263   
- Partials          0          1     +1   

Powered by Codecov. Last update 00c3f80...0ec6ea5

@jancborchardt
Copy link
Member

@ChristophWurst can you also check this then to make sure it kinda is in line with what you are doing? Or that there’s no duplicate work or conflicts?

@ChristophWurst
Copy link
Member

@jancborchardt We should merge this one first since #2924 doesn't modify header.scss as much as this pr :)

I'd way we merge mine first then @skjnldsv has to do the merge conflict resolution fun 😉

@skjnldsv
Copy link
Member Author

Please don't! 😭

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicked a bit around and looks good 👍

@LukasReschke LukasReschke merged commit 5809164 into master Jan 19, 2017
@LukasReschke LukasReschke deleted the header-scss-optimisation branch January 19, 2017 01:25
@LukasReschke
Copy link
Member

Sorry @ChristophWurst 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews design Design, UI, UX, etc. feature: scss
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants