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

500 error #1

Open
matjazpotocnik opened this issue May 31, 2021 · 5 comments
Open

500 error #1

matjazpotocnik opened this issue May 31, 2021 · 5 comments
Assignees

Comments

@matjazpotocnik
Copy link

Hi!

I tried the Tweaker, but it looks like something is wrong with AdminThemeTweaker.php. I get 500 internal error. If I remove these lines:

 --admin-masthead-color   :<?php echo $masthead_color   ? $masthead_color : $masthead_bckgnd 
                                                         ? hexRGBA(getContrast($masthead_bckgnd),0.75) : 'var(--admin-body-contrast-75)' ; ?>;    
  --admin-footer-color     :<?php echo $footer_color     ? $footer_color   : $footer_bckgnd
                                                         ? hexRGBA(getContrast($footer_bckgnd),0.85)   : 'var(--admin-body-contrast-85)' ; ?>;

then it works.

The module works by adding a CSS file generated by PHP to overwrite styles applied by AdminThemeUikit? That means some minimal extra processing time, and also browser does not cache the file?

@chrisbennett-Bene chrisbennett-Bene self-assigned this Jun 2, 2021
@chrisbennett-Bene
Copy link
Owner

chrisbennett-Bene commented Jun 2, 2021

Hi Matjaž, sorry I missed your issue earlier.
Thanks for the feedback. I will have a look and see if I can find out what was going wrong.

Yes, there will be minimal extra processing time and the browser won't cache the php.
Comes in at just over 100kB at the moment, and around 500ms on a refresh when other files are cached, so not something I notice while working in comparison with the other things getting loaded.

It just seems like a normal page load to me, though would be interested in hearing if anyone experiences different. Have been considering "flattening" as plain CSS file if the need arises.

@chrisbennett-Bene
Copy link
Owner

Couldn't reproduce the 500 but have cleaned up some stuff that might have been responsible.
Would very much appreciate if you could give it another go with the updated files and let me know if you still experience problems.

Thanks again for trying it out and helping me iron out any problems

@chrisbennett-Bene
Copy link
Owner

Thanks again for the feedback Matjaž, it has been very helpful.

Have re-worked everything to minimize possible conflicts and because it was just a better idea.
As soon as I saw your initial comment, I knew deep down I was going to do it :)

Now draws CSS variables, conditionally loaded source CSS and framework CSS together to generate single minified CSS file, with version control link to refresh cache for other pages.
Only occurs when the module is visited and, as it should, after that other pages draw the CSS straight from cache.
Loads in parallel with the other CSS. at somewhere around 30ms. Happier with that.

First load (in the module itself, not subsequent pages) comes in around 17 kB compressed., so considerable benefit, especially given the elimination of almost all processing overhead. Very happy I was prodded into action by your feedback.

Took a little time, but am very happy going forward.

As part of the re-working, am in process of splitting up CSS for conditional loading according to user selections, which opens up a far greater range of user options, which I will roll out to module as I go. As a bonus for me, splitting the source CSS up is making it easier for me to track and alter.

@matjazpotocnik
Copy link
Author

matjazpotocnik commented Jun 4, 2021

I tested new version, but this time:

Compile Error in CSSvariables.php:151
Unparenthesized a ? b : c ? d : e is not supported. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e)

Also the layout is somehow "unaligned":
image

image

@chrisbennett-Bene
Copy link
Owner

Thanks Matjaž, you are a legend and your help is much appreciated.

Fixed the two problem nested ternarys in 7.4 and up.
No need for them anyway now it's not loading the php every page, so reverted to more readable if/elseif/else.
Thanks for helping out with that, still on 7.3 and I use them so rarely that I didn't realize earlier.
Valuable reminder for me, so your help tracking down the issue is great!

Am continuing work on the CSS over the weekend and will investigate the broken alignment.
I guess it may be related to the broken ternarys filtering through messing things up, but I will see what I can see.

Thanks again, you rock!

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

No branches or pull requests

2 participants