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
Add current theme higher priority than for Morpheus. #323
Conversation
as far as I understand the themes inherit from Morpheus so Morpheus should be loaded first and then other themes should be loaded. If there is a good reason to load current theme before Morpheus, maybe you can give me an example? |
As I tested - this change should prioritise third-party theme which is currently active and move this theme less file at the end of final css file. I'll test this again and confirm this behavior. Please, don't close this PR before my confirmation. |
Sounds good! Have a good holiday |
@czolnowski any update? maybe this needs to go in 2.4.0 so looking forward to it. |
https://www.dropbox.com/s/orxak0l8fdutrri/323_PR.png |
Are you seeing the custom theme loaded before Morpheus? That would be a bug. If the custom theme is loaded after Morpheus, then it's working. |
"Are you seeing the custom theme loaded before Morpheus? That would be a bug." - this is behavior in current master. "If the custom theme is loaded after Morpheus, then it's working." - this is behavior with my PR applied. |
But one thing to improve would be to move Morpheus just one step before custom theme. Now I think it's incorrect, because Morpheus loads before other Piwik CSS files. |
@mattab: Please, take a look now. Morpheus and custom theme working together. If custom theme is enabled then order is: Morpheus -> Custom theme. And this is backward compatible. |
Cheers I've tested quickly and looks correct. I made smalll suggestion: czolnowski#2 |
Hi @mattab. I've add comment to your patch: czolnowski#2 (comment) |
Ok I understand now... LESS compiler does not work as we expected http://stackoverflow.com/questions/15383869/overriding-bootstrap-less-variables-after-import Maybe we have to fork and extend, or inherit the lessC compiler? The new feature would be to allow defining variables in later content, and that the last variable value would be used. For this maybe we could detect all variables used in any of the files and imported files, then move those variables up and first in the Less merged file, and then compile the less file and less would replace variable names by their latest defined value. Thoughts? |
Here is my test procedure:
This works without and with the pull request. |
Add current theme higher priority than for Morpheus.
well actually... @tsteur said that when we load the theme files last, it should work and overwrite all variables defined before. If you find that this is not true please send us a test theme and steps to reproduce the issue and we will investigate issue. |
Adding this line gave higher priority for third-party theme, but doesn't cause problems described in this commit:
b06b118
Maybe this will fix bug with third-party themes! :)