Skip to content

Make CSS simpler using macro#738

Merged
stevenjoezhang merged 6 commits intotheme-next:masterfrom
stevenjoezhang:css
Mar 28, 2019
Merged

Make CSS simpler using macro#738
stevenjoezhang merged 6 commits intotheme-next:masterfrom
stevenjoezhang:css

Conversation

@stevenjoezhang
Copy link
Contributor

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.

.post-eof,
.post-spread {
hide();
display: none !important;
Copy link
Member

Choose a reason for hiding this comment

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

Need to recheck here, because values in base without !imortant.

hide() {
display: none;
}
show() {
display: block;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have tested, this is an exception. All other ‘display: none’ style can be replaced with macro ‘none()’

Copy link
Member

@ivan-nginx ivan-nginx Mar 26, 2019

Choose a reason for hiding this comment

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

So, need to fix it somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No better solution, I think.

Or we can remove show, hide and circle macros. Currently, they are only used a few times.

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.

So, need any solution. For now you suggest Improvment (Optimization), but give 1 additional Bug with this.

Mb u can see why was !important there? And try to resolve this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

display: none !important is used to overwrite the display: block style in .post-eof in scheme Gemini. To make sure it works on all browsers, an !important is needed. It won't cause additional bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove show, hide and circle macros is another way. What's your opinion?

Copy link
Member

Choose a reason for hiding this comment

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

display: none !important is used to overwrite the display: block style in .post-eof in scheme Gemini. To make sure it works on all browsers, an !important is needed. It won't cause additional bug.

I know it, why u say me what I already know? Question is: why there are used !important? What rewrited? Why only for Gemini? How to make without rewriting (without !important)? Is it possible? If possible, need to try it, yeah?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I understand. I'll open another PR to reduce the usage of !important.

@stevenjoezhang
Copy link
Contributor Author

About !important: #744
So, what's next? Use hide() instead of display: none, or use display: none instead of hide()? The current situation is that the macro hide() is defined, but we barely use it.

@ivan-nginx
Copy link
Member

Of course use macro hide(). It's global var.
But in #744 seems some troubles with non-relevant changes.

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.

Milestone.

@stevenjoezhang stevenjoezhang added this to the v7.1.0 milestone Mar 28, 2019
@stevenjoezhang stevenjoezhang merged commit 2cae2f4 into theme-next:master Mar 28, 2019
@stevenjoezhang stevenjoezhang deleted the css branch March 28, 2019 12:13
@liolok liolok changed the title Using macro to make CSS simpler Make CSS simpler using macro Mar 31, 2019
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