-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Support of @media only
#2140
Comments
Hi! Thanks for the report. Media queries are not very well supported, this is an old problem, see #494. The main problem we have with media queries is that it’s hard to define the viewport dimension on paged media. But supporting "only" (and probably "not", "or" and "and", as long as we have only media types) is actually much easier. Interested in adding this feature? That’s a good first issue if you have some Python skills and no idea about how WeasyPrint works! The magic happens here: WeasyPrint/weasyprint/css/media_queries.py Lines 25 to 39 in d5d7ce3
|
@liZe I currently don't have the time right now. But I would be glad to help. BTW, will there be a coding sprint for weasyprint at PyCon FR 2024? I planned to come and help Julien for the Python docs translation, but I would be happy to better understand weasyprint that I use quite often. We saw each other during last AFPy's assemblée générale ! |
No problem, let’s save this chance to another newcomer!
😄 I don’t think that we’ll have the time to organize a coding sprint because we’re quite busy with the organization (and Julien will be happy to have you). But we’ll probably find the time to talk about WeasyPrint’s internals! |
I imagine it takes time to organize everything. Yes, see you in Strasbourg! |
With weasyprint 62, I get
WARNING: Invalid media type ' only print ' the whole @media rule was ignored at 3:5.
for the following HTML:According to https://www.w3.org/TR/mediaqueries-5/#typedef-media-query-list this is valid CSS.
only
seems not supported yet (I haven't testednot
,or
,and
for@media not screen
for instance).I can easily workaround this limitation by removing
only
.The text was updated successfully, but these errors were encountered: