Jump to content
Sign in to follow this  
bxbmedia

Child theme section override css loading before core section in compiled css

Recommended Posts

bxbmedia

I'm trying to make a simple css change in my feature section using my child themes overridden feature section's style.less. My question is not about how to make the change I want, but about overriding core sections. The framework is loading both styles in the compiled css but appears to be loading the child theme's section css before the core section's. 2ezn536.jpg Is this a bug? In 2.1 and below, it was my understanding that when core sections were overridden by child themes that none of the core section's files were loaded. Has there been a change in the way that core sections can be overridden now?


gl hf

Share this post


Link to post
Share on other sites
beardedavenger
Try being more specific with your CSS selectors. For example, in your Child CSS, adding #page to the beginning applies more importance to this rule (and it's better than using !important) #page #feature_slider .text-bottom .fcontent .ftext { ... } Nick

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
bxbmedia
Thanks Nick, Yes, that would work to set the css but, that's not what my question was about. Shouldn't all child styles whether it be for the theme or sections, be loaded after the parent framework's? And when a core section is overridden in a child theme, why are any of the parent's section files being loaded?

gl hf

Share this post


Link to post
Share on other sites
beardedavenger
[quote]Shouldn't all child styles whether it be for the theme or sections, be loaded after the parent framework's?[/quote] Yes, and that's how it works. [quote]And when a core section is overridden in a child theme, why are any of the parent's section files being loaded?[/quote] If you have a copy of the section inside your /sections folder in your child theme, it will load that section AND the core section unless you deactivate the core section. Nick

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
bxbmedia
Thanks for clarifying. I forgot you could deactivate core sections. The reason I asked about the order of child parent sections loading is based on what I saw in the css shown in my OP above. The parent section styles were being output [i]after[/i] the child section's. Is this a bug or am I still not understanding it? Thanks again.

gl hf

Share this post


Link to post
Share on other sites
Rob
I don't think its a bug as we're not getting dozens of complaints on this issue.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
bxbmedia
@rangelone - So unless you're getting dozens of complaints about something it's not a bug? Dozens of people on this forum are having issues with simple css changes, does that mean that there's a bug? Of course not, so don't use that as a criteria for defining a bug. I understand developers have priorities and one person's issue is not as important as many others that have a different issue, but any issue is an important one if you want to provide good customer service. My question was fairly straightforward and provided with solid evidence to what I experienced. It's not a huge deal because my site isn't crashing because of it, but it's worth bringing to developers' attention if it's not the expected behavior.

gl hf

Share this post


Link to post
Share on other sites
Rob
First, I did not say definitively that it is not a bug. I expressed an opinion saying "I don't think..." Second, you said "I understand developers have priorities and one person's issue is not as important as many others that have a different issue, but any issue is an important one if you want to provide good customer service." In fact, we take EVERY issue very seriously and do not dismiss yours or anyone else's situations with our product. Nick replied to you with the official answer and explained that as you are experiencing it is how it works and how it should work. Thus, in reply to your last question, I expressed my opinion. I'm sorry if you don't like my thoughts, but I did not close your topic or dismiss your opinion either. He is a developer... He is aware of it... and he answered it. Do you need further clarification? If you do, I will happily ask one of the developers to give you a further explanation of why it happens as it does.

Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
bxbmedia
@rangelone, let's be friends. As you see I thanked Nick for his answer, I know he is a developer and I value his response. Before I was going to accept his answer, I had one follow up question as I still don't see how the framework is behaving the way I understand it should and the way he says it does. [quote][quote]Shouldn't all child styles whether it be for the theme or sections, be loaded after the parent framework's?[/quote] Yes, and that's how it works.[/quote] Great! So my question is then why is child section css being loaded before parent section css in the complied css shown in my image? Line 2279 (child css) comes before line 3198 (parent). Now, Nick reminded me that parent sections can be disabled, and this would completely solve my problem as my child section would no longer have to compete with the parent's. The only question I had remaining was why if child is loaded after parent, why I was seeing something that seemed to contradict that. That's it. I admitted that I may not understand why and asked for clarification.

gl hf

Share this post


Link to post
Share on other sites
Simon
Try class.render.css.php here: http://paste.pagelines.com/1ot

Share this post


Link to post
Share on other sites
beardedavenger
Hah! OK let us know what you think of that patch above. I kept looking back at your screenshot and I was like, it is loading first, then I look at the line numbers. hah! 2279 does come before 3000. lololol Nick

Something big is coming for DMS + photographers.

http://fotostheme.com

 

Nick Haskins & CO - New home for all of my PageLines Store products! 

http://nickhaskins.co

 

Better DMS - News, Tutorials, and Tips

http://betterdms.com

 

Share this post


Link to post
Share on other sites
bxbmedia
It worked! You guys are great. Thanks a lot for taking the time to look deeper into this, See my results here if you want: [url="http://imgur.com/a/Zvoeh"]http://imgur.com/a/Zvoeh[/url].

gl hf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×