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

Reduce the use of !important for GitHub banner #744

Merged
merged 6 commits into from
Mar 30, 2019
Merged

Reduce the use of !important for GitHub banner #744

merged 6 commits into from
Mar 30, 2019

Conversation

stevenjoezhang
Copy link
Contributor

@stevenjoezhang stevenjoezhang commented Mar 27, 2019

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines.
  • Tests for the changes was maked (for bug fixes / features).
    • Muse | Mist have been tested.
    • Pisces | Gemini have been tested.
  • Docs in NexT website have been added / updated (for new features).

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue resolved: N/A

What is the new behavior?

  • Screenshots with this changes: N/A
  • Link to demo site with this changes: N/A

How to use?

In NexT _config.yml:

...

Does this PR introduce a breaking change?

  • Yes.
  • No.

@wip ready for review

Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

Non-relevant to GitHub banner.

@stevenjoezhang
Copy link
Contributor Author

@ivan-nginx The title of this PR is called Reduce the use of !important

}
+tablet-mobile() {
> svg {
if (scheme == 'Pisces') || (scheme == 'Gemini') {
fill: #fff !important;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here. Please, have a look.

Copy link
Member

@ivan-nginx ivan-nginx Mar 27, 2019

Choose a reason for hiding this comment

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

U say u fix hide() with !important. GitHub banner nothing to do with this.
Also, u brake foreground styles for GitHub banner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My mistake, it's not just about hide()
And I have tested, it's fine in all resolution, doesn't brake foreground styles

@1v9 1v9 added this to the v7.1.0 milestone Mar 29, 2019
@1v9 1v9 added the v6.x label Mar 29, 2019
@stevenjoezhang
Copy link
Contributor Author

I believe this PR is ready to be merged now. No other work needs to be done

@@ -76,8 +76,7 @@ use_seo = hexo-config('seo');
}

// Post delimiters.
.post-eof,
.post-spread {
Copy link
Member

Choose a reason for hiding this comment

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

Are we remove this class? I don't remember...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't find post-spread in NexT... seems it has been removed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

All refactoring like this must be tested carefully. Screens with each scheme & resolution also needed and welcome.

@@ -34,8 +43,7 @@
+mobile() {
> svg {
if (scheme == 'Mist') {
top: inherit !important;
margin-top: -50px;
Copy link
Member

Choose a reason for hiding this comment

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

I believe u not test on all schemes with all resolutions:

image

Don't need remove parameters if u don't know for what they are. If parameter present, then he's needed for something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course I know what I'm doing. It looks fine in my browser.
屏幕快照 2019-03-30 上午1 56 17
Are you using the latest branch?

Copy link
Member

Choose a reason for hiding this comment

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

Oh, my fault: i forgot to checkout your pull.

@@ -10,7 +9,7 @@
}

.post:last-child {
.post-eof.post-eof.post-eof {
Copy link
Member

Choose a reason for hiding this comment

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

Screen? Where is this class?

Copy link
Contributor Author

@stevenjoezhang stevenjoezhang Mar 29, 2019

Choose a reason for hiding this comment

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

Not sure. But it's same as .post-eof, no need to repeat 3 times

Copy link
Member

@ivan-nginx ivan-nginx Mar 29, 2019

Choose a reason for hiding this comment

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

This thing need to add delimeter between posts in homepage. And of course, last delimeter no needed, that's why display none on last child:

{% set isLast = loop.index % page.per_page === 0 %}
{% if is_index and not isLast %}
<div class="post-eof"></div>
{% endif %}

Copy link
Member

Choose a reason for hiding this comment

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

But see, in Gemini I make same feature with another way:

// When blocks are siblings (homepage).
#posts > article + article {
.post-block {
margin-top: $sidebar-offset;
// Rewrite shadows & borders because all blocks have offsets.
box-shadow: $box-shadow;
border-radius: $border-radius;
}
}

IDK which method is better, but I think need to choose only one.

Copy link
Member

@ivan-nginx ivan-nginx Mar 29, 2019

Choose a reason for hiding this comment

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

So, in Muse and Pisces – .post-eof enabled.
In Mist – disabled and in Gemini – disabled & implemented with another way.

Need to do refactor for that and join 2 spitted functions into better one.

@ivan-nginx ivan-nginx changed the title Reduce the use of !important Reduce the use of !important for GitHub banner Mar 29, 2019
Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

source/css/_schemes/Mist/_posts-expanded.styl (11)

@1v9
Copy link
Member

1v9 commented Mar 30, 2019

Sorry @stevenjoezhang I made test again for WIP, there's a pending status of WIP, add @wip ready for review in PR body can pass pending, look like this: WIP Successful in 1s — Ready for review

PR template need to update 😉

@1v9 1v9 mentioned this pull request Mar 30, 2019
15 tasks
@stevenjoezhang
Copy link
Contributor Author

Anything else need to do with this PR?

Copy link
Member

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

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

It seems all fine.

@stevenjoezhang stevenjoezhang merged commit 56555b9 into theme-next:master Mar 30, 2019
@stevenjoezhang stevenjoezhang deleted the important branch March 30, 2019 11:47
tongluyang pushed a commit to tongluyang/hexo-theme-next that referenced this pull request Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants