Skip to content

[PREVIEW] Dark mode and scss #383

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

Closed
wants to merge 2 commits into from
Closed

[PREVIEW] Dark mode and scss #383

wants to merge 2 commits into from

Conversation

jkowalleck
Copy link
Contributor

As stated via a comment in #381:
here is a proposal how consolidating the colors in a reusable way may look like.

A comment in #381 made me feel like old browsers need support.
Using css variables was not a choice, since

this PR's solution has some notable impact:

  • style.css is now based on SASS/SCSS that is split into logical modules.
    editing the css is quite easy. Its SCSS now, which is pretty similar to the previous CSS.
    generating the style.css from SCSS/SASS was made aeasy via command npm run build-css.
  • Folder pytest_html was moved down to folder src. for easy overview.
    This was done, since the layout is now a SASS/SCSS that generates code. To have developers aware of this, the additional SASS/SCSS files were moved in a place, where they can be seen easily as code.
    Furthermore, since the generated code is compressed, a frontend-developper will see where it comes from just by traversing the path to the generated css.
  • style.css is compressed/minified, now. its not human-readable anymore.
    i think this is a good decision. package becomes smaller, output from pytest_html becomes smaller.

@gnikonorov
Copy link
Member

Thanks @jkowalleck, this is awesome! Does that mean we can close #381 in favor of this one? I'm all in favor for switching to SCSS while introducing dark mode. I was going to ask you to raise a separate issue for it originally

@jkowalleck
Copy link
Contributor Author

Thanks @jkowalleck, this is awesome! Does that mean we can close #381 in favor of this one? I'm all in favor for switching to SCSS while introducing dark mode. I was going to ask you to raise a separate issue for it originally

i think so.

If this PR is good enough, i would be happy if #381 was closed.
This means: i will modify the Changelog of this PR, when it is time to do so.

@gnikonorov
Copy link
Member

Let's close it then. Unless @BeyondEvil has an issue with us moving to SCSS while we do this

@BeyondEvil
Copy link
Contributor

By "close" you mean discard, correct? As this seems to have the same changes as #381 ?

I wonder if these changes warrant a major release? 🤔

I'd like input from @ssbarnea as well. But it looks good to me. 👍

@jkowalleck
Copy link
Contributor Author

By "close" you mean discard, correct? As this seems to have the same changes as #381 ?

I wonder if these changes warrant a major release? thinking

I'd like input from @ssbarnea as well. But it looks good to me. +1

yes, @BeyondEvil. if this very PR is fine, i will discard #381,
since the features from #381 are in the very PR, too.


* Thanks to `@jkowalleck <https://github.com/jkowalleck>`_ for the PR

* Support for dark mode (`#381 <https://github.com/pytest-dev/pytest-html/issues/381>`_)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🔧 need to remove this, when #381 is closed

&.skipped,
&.xfailed,
&.rerun {
font-weight: bold;
Copy link
Contributor Author

@jkowalleck jkowalleck Nov 26, 2020

Choose a reason for hiding this comment

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

this is new,
i fealed like i needed it bold for better readability.

}
}

.col-result {
Copy link
Contributor Author

@jkowalleck jkowalleck Nov 26, 2020

Choose a reason for hiding this comment

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

this is new,
i fealed like i needed it bold it for better readability.

@codecov-io
Copy link

codecov-io commented Nov 27, 2020

Codecov Report

Merging #383 (b053cf5) into master (67d2135) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #383   +/-   ##
=======================================
  Coverage   97.63%   97.63%           
=======================================
  Files           4        4           
  Lines         423      423           
=======================================
  Hits          413      413           
  Misses         10       10           
Flag Coverage Δ
tests 97.63% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/pytest_html/__init__.py 71.42% <ø> (ø)
src/pytest_html/extras.py 100.00% <ø> (ø)
src/pytest_html/hooks.py 100.00% <ø> (ø)
src/pytest_html/plugin.py 97.91% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67d2135...b053cf5. Read the comment docs.

* created a folder `src` and moved the existing `pytest_html` into it.
* transferred `.../resources/style.css` to scss and had it split. als
  added some variables.
* made the colors applied via a scss mixin for light- and dark-theme.
@ssbarnea ssbarnea self-requested a review November 27, 2020 11:59
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

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

I am in favor of the proposed change, likely all parts of it. There is only one problem: it does combine unrelated changes, and major ones.

For example, I am really happy to see the move of module inside src/ folder, which is following the recommended practices. Still, this rename should be done without touching anything else.

The same can be said about adoption of scss, which is ok by its own but not combined with addition of another mode.

Changes should be atomic, implementing only one feature at a time. Otherwise we risk introducing too many bugs and doing a poor job reviewing it.

My proposal: keep this open but make another change that is doing only the src move. Once we merge you can rebase and the size will go down.

@jkowalleck jkowalleck marked this pull request as draft November 27, 2020 12:46
@jkowalleck jkowalleck mentioned this pull request Nov 27, 2020
@jkowalleck
Copy link
Contributor Author

jkowalleck commented Nov 27, 2020

I am in favor of the proposed change, likely all parts of it. There is only one problem: it does combine unrelated changes, and major ones.

For example, I am really happy to see the move of module inside src/ folder, which is following the recommended practices. Still, this rename should be done without touching anything else.

The same can be said about adoption of scss, which is ok by its own but not combined with addition of another mode.

Changes should be atomic, implementing only one feature at a time. Otherwise we risk introducing too many bugs and doing a poor job reviewing it.

My proposal: keep this open but make another change that is doing only the src move. Once we merge you can rebase and the size will go down.

❤️ i agree with you, @ssbarnea.
Marked this very PR as a draft and will leave it open. Closed #381.

Created a src move PR #384, to have this change atomic.

Create another PR #385 on top of #384, that introduces use of SASS/SCSS as a atomic change.

Will create another PR on top, that adds dark mode as a feature.

This was referenced Nov 27, 2020
@jkowalleck jkowalleck changed the title Dark mode and scss [PREVIEW] Dark mode and scss Nov 28, 2020
@jkowalleck
Copy link
Contributor Author

SCSS was integrated as needed into maaster branch.
will create PR for theming soon

@gnikonorov gnikonorov added the feature This issue/PR relates to a feature request. label Dec 13, 2020
@jkowalleck jkowalleck mentioned this pull request Dec 26, 2020
4 tasks
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants