Skip to content

Use CSS instead of JS for floating docs banner [#1988] #2075

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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

arpan8925
Copy link
Contributor

@arpan8925 arpan8925 commented May 15, 2025

Use CSS instead of JS for floating docs banner

Fixes #1988

@arpan8925
Copy link
Contributor Author

arpan8925 commented May 15, 2025

@adamzap Can you review kindly !

#1988 Fixed

@adamzap
Copy link
Member

adamzap commented May 16, 2025

@arpan8925 Could you squash your commits into one?

@arpan8925
Copy link
Contributor Author

Give me some time, exam is going on, trying this as soon as possible in next 2/3 days

@adamzap
Copy link
Member

adamzap commented May 16, 2025

Sure! If you need some guidance to squash the commits, you can do it in at least two ways:

  1. Run git rebase -i HEAD~16 and mark every commit after the first one as "fixup" (f), then git amend the commit message before force-pushing.
  2. Delete your branch locally, look at the diff view on GitHub, reproduce those changes in one commit locally on a new branch with the same name, then force-push.

Let me know if you have trouble.

@arpan8925 arpan8925 requested a review from marksweb May 17, 2025 13:16
@arpan8925
Copy link
Contributor Author

updated @adamzap , review kindly

@arpan8925
Copy link
Contributor Author

Hi @marksweb Can you check if yours Change Request is resolved?

}

/* Modern browsers that support :has() */
@supports selector(:has(a, b)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem to work.

❯ make compile-scss
python -m pysassc djangoproject/scss/output.scss djangoproject/static/css/output.css --style=compressed
pysassc.py: error: Error: Invalid CSS after "@supports ": expected @supports condition (e.g. (display: flexbox)), was "selector(:has(a, b)"
        on line 28:10 of djangoproject/scss/_style.scss
        from line 4:1 of djangoproject/scss/output.scss
>> @supports selector(:has(a, b)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok Checking

Copy link
Contributor Author

@arpan8925 arpan8925 May 20, 2025

Choose a reason for hiding this comment

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

The issue was happening for, actually pysassc does not support modern selector-based feature queries like: @supports selector(:has(#dev-warning)) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I left with 2 Options acutally

Using JavaScript-based detection only
or
Using PostCSS or Dart Sass via a JS or Node build chain instead of LibSass of pysassc .

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, unfortunately I think we're stuck with the JavaScript approach for now. Do you agree @marksweb?

@marksweb marksweb changed the title Arpan issue 1988 Use CSS instead of JS for floating docs banner [#1988] May 19, 2025
Copy link
Contributor

@marksweb marksweb left a comment

Choose a reason for hiding this comment

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

I'm happy with this now, providing everyone's happy with how it looks.

@adamzap
Copy link
Member

adamzap commented Jun 6, 2025

@arpan8925 I'm reviewing this as well. Thanks for the changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use CSS instead of JS for floating docs banner
3 participants