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

Grunt task complains about !important in styles.css #67

Closed
revosw opened this issue Feb 6, 2021 · 6 comments
Closed

Grunt task complains about !important in styles.css #67

revosw opened this issue Feb 6, 2021 · 6 comments
Assignees
Labels
ci Continuous Integration

Comments

@revosw
Copy link

revosw commented Feb 6, 2021

When grunt runs the stylelint:css task, it complains about these lines

.questionlist li .controls .name .MathJax_Display {
text-align: left !important;
margin: 0 !important;
}

@revosw
Copy link
Author

revosw commented Feb 6, 2021

Is a css preprocessor like sass/less or anything involved in producing this file?

@andstor
Copy link
Member

andstor commented Feb 6, 2021

No, that file is handwritten. If the !important is actually necessarily I don't know. If the CI complains about it, it might be favorable to check if the rule can be mitigated. Alternatively, the warning could be depressed.

@hgeorgsch
Copy link

@sebastsg Do you have a quick comment on !important in JazzQuiz CSS?

My guess is that it has been too hard to narrow down the tag/class definition to override what should be overridden, and !important provides a quick fix.

@sebastsg
Copy link
Member

sebastsg commented Feb 8, 2021

@hgeorgsch I never add !important for fun, so I'm pretty sure it's to override MathJax. I'll take a look soon.

@hgeorgsch
Copy link

I thought it should be possible to get it right with a narrower class definition, just bloody hard; that has been my experience so far. But yes, since the last class is MathJax_Display, I am sure that is the reason.

Oddly, when I check the source of an actual JazzQuiz page, I find only one or two CSS files and they do not show any other definitions for MathJax_Display. May this be out of date? Or is it a tag attribute style which has to be overridden? I did not have the chance to test with a full student view.

@hgeorgsch hgeorgsch added the ci Continuous Integration label Apr 28, 2021
@jorgenfinsveen
Copy link

Tried removing !important from the CSS and reload the page. Did not seem to affect the style, so I don't believe we need to use !important anymore. Tested by comparing two containers where one container hosted Jazzquiz with the !important statement in the CSS, and one without. They were identical (tested this at different resolutions as well).



Screenshots from pages which uses the CSS statements in question:


The list on the left is target for the CSS block. It doesn't seem to be affected after removing !important
Skjermbilde 2023-07-31 kl  15 33 27



Dropdown-menu is also target for the CSS, but has not changed after removing !important
Skjermbilde 2023-07-31 kl  16 07 31


I also looked for elements of the MathJax_Display class by using inspect element, but I could not find any mentions of the class anywhere. Also checked the source code of Jazzquiz and the source code of Moodle version 4.1 and version 4.3, and the only place where the phrase MathJax_Display is mentioned is in this CSS file. As @hgeorgsch mentioned, it is likely that MathJax_Display is outdated.

All in all, I don't think we need !important in the CSS anymore.

@jorgenfinsveen jorgenfinsveen self-assigned this Jul 31, 2023
@jorgenfinsveen jorgenfinsveen linked a pull request Jul 31, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous Integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants