The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
css in usersc
#1
I'm trying to style the navigation items (e.g. menus) in the header.  The css styles that I put in usersc/css/custom.css are not picked up when the page is rendered.  When I put the same style code in users/css/custom.css, it works.  Have I misunderstood how the usersc->users override system works?  Why are my styles in the usersc/css/custom.css ignored?  When I want to override a file, do I have to manually specify that somewhere?
  Reply
#2
(02-01-2019, 08:08 PM)haydentech Wrote: I'm trying to style the navigation items (e.g. menus) in the header.  The css styles that I put in usersc/css/custom.css are not picked up when the page is rendered.  When I put the same style code in users/css/custom.css, it works.  Have I misunderstood how the usersc->users override system works?  Why are my styles in the usersc/css/custom.css ignored?  When I want to override a file, do I have to manually specify that somewhere?

Can you tell me what version you're on?
custom.css will override the default template in version 4.4 but only that one. 

If you're not on 4.4, it's probably where you want to be. You can copy any template and edit it to your heart's content.  Just be aware that we will offer a few template updates on 4.4.02or3 to provide support for multilanguage sites. You'll want to push those updates to your template as well.
  Reply
#3
I'm on the release version of 4.4, using the default template.
  Reply
#4
So I would do any overriding that you want to do in the file usersc/includes/head_tags.php and see if that allows you to make the changes you want to make without breaking other things.
  Reply
#5
OK, I figured out what's going on here.  users/css/custom.css is the 3rd default css location, as set in the db field settings.us_css3.  This location is put in the db by default during installation.  I proposed that we default to usersc/css/custom.css instead, so that we don't encourage people to put code in users/ that could be overwritten by an update.

On another note, I can't find any way to get to the UI to change this value, so I had to edit the field directly in the database.  There is an admin view called _admin_css_settings.php that allows this setting to be changed, but I can't find anywhere in 4.4 where you can navigate to this view.  If you look in admin.php, nothing includes _admin_css_settings.php.  I remember that you could do this in 4.3, so this appears to be a regression.


So there's 2 issues to be fixed: default to usersc/css/custom.css for the 3rd css location, and provide access in the UI to see/change those css locations.
  Reply
#6
On the first note, we definitely need to work on that. The things that are in that CSS file are primarily intended for the default template, which happens to take over both the front and backend.

The thought is that most people will use frontend templates and will have full control over all the css in there.

The second is similar. Since you upgraded from 4.3, you have these legacy values (which aren't hurting anything and in some cases can be helpful. In UserSpice 4.4, you have full templates (you can just copy an existing template to another folder, rename it and be on your way.

I know it seems weird at first, but what you're dealing with is people wanting bootstrap 4, but if we update core US to bs4 then it will immediately break people's systems. They'll loose things like wells, glyphicons and col-xs-anything will break. It would be terrible. There are also people who want to upgrade to font awesome 5, which is great, but it looses a lot of icons that we use and changes the fa- names to call an icon.

So a few things are going on here. Bootstrap and Font awesome decided to make changes that leave their users scrambling to do find/replace throughout their entire projects to use the new version. I felt like this was hostile towards users, so the "default" US4.4 template is exactly like the old one. Nothing changes. Then from there, templates are a free for all. You can even choose not to include bootstrap, jquery, or font awesome in your own templates and UserSpice won't care.

Things will smooth out as more and more people (like you) point out bugs in 4.4. Soon we will allow people to share their widgets, templates, and plugins and then the flexibility will really grow.
  Reply
#7
So if I understand you correctly, nobody should be using custom.css at all (in users or usersc), but just making our css modifications in a template?


If so, that actually makes a lot of sense.  It also explains the lack of that admin view to set css locations.  I learned UserSpice in 4.3, so I'm not used to templates at all.
  Reply
#8
First of all, sorry for the slow response. Yes, that's why it's not being used in 4.4. If you want to add some sort of style that overrides every template in every situation (like a custom.css would have in the past), my suggestion is to do it either in style tags or with an include in usersc/includes/head_tags.php

That will be called on every page and won't be broken by anything else we do.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)