Question

Posted · Report post

Hello,

 

Firstly I apologise that this is not a specific DMS2 question but it would certainly be great to get some advice on the following please: I have an annoying problem trying to identify which CSS is coming from my style sheet when using Chrome (inspect). I am adding CSS using the Pagelines Customize Plugin and have used CSS to improve the look of the web elements created from the woocommerce plugin. However, I have noticed that some of my CSS is creating problems but when I inspect en element it shows me heaps of code from woocommerce. What I really want is a way of being able to select an element (using Chrome) and ask to only show code coming from the pagelines customize plugin. Then I could quickly identify what CSS from my style sheet is causing the problem instead of having to spend ages toggling on and off properties until I find the right one from my style sheet.

 

Please do let me know if something like this is possible?

 

Kind regards,

 

James

Share this post


Link to post
Share on other sites

16 answers to this question

  • 0

Posted · Report post

Can we have a link to your site so we can see exactly what you mean and we can try to help. 

 

I think the best method of defining which CSS to change is using Firebug http://getfirebug.com/

 

Firefox's version of Firebug is more feature packed and easier to dig deeper. 

 

Also the best advice i can give is if you are adding code to your stylesheet / customize plugin you should be annotating it so you know what each piece does. 

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

/*I wish I did that more often, especially when testing others fixes on a test site*/

"Also the best advice i can give is if you are adding code to your stylesheet / customize plugin you should be annotating it so you know what each piece does."

 

Top tip!

2 people like this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks very much for the tips above! I normally write many /*anotations*/ but unfortunately I ended up stopping. I have more CSS issues with woocommerce as I find it far more difficult to style and less obvious than DMS. I know the problem is within my style sheet (customise plugin but opened in Sublime) because if I cut out my code and save the document the problem goes away. It's just a matter of finding my code changes in amongst the tons of code applied by woocommerce.

 

I will take a look at Firefox but normally use Chrome as DMS only works in Chrome.

 

Thanks,

 

James 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi GetMeWebDesign,

 

Yes I have but thanks very much for passing on the link. I have used the above and it's very useful indeed.

 

Cheers,

 

James

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

You can use Firefox too if you change the browser string via a plugin

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks Simon_P, could you please let me know what plugin you would recommend to work best with DMS. I will give it a go!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

In my opinion, I find it incredibly more difficult to use FireBug over Chromes dev tools. Also, you aren't able to select an option that would allow you to specify which stylesheet or class is causing your issue. As all the LESS and CSS gets compiled into one dynamic stylesheet.

 

However, you should always comment your code, so that both yourself and other designers/developers know exactly what your code does.

 

Here is an example:

 

https://gist.github.com/anonymous/c83d2e0d5e5185eb6f76

 

By see the above, anyone will understand what that code actually does.

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

That's great Danny. However, you don't see the comments when using Chrome (inspect). I can see the comments in my own stylesheet when opened in Sublime but I find it more difficult to distinguish what is woocommerces CSS and what is my own when making changes with Chrome (inspect). Being able to turn on comments would be great as that would allow me to scan all the CSS and search for a comment in Chrome (inspect) as it would be a quick way of identifying my CSS code. However, I don't think this is possible in Chrome (and possibly Firefox)

 

Thanks, J

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Well you should know what your code is as you added it, also WooCommerce has its own styling which comes from its own stylesheets, which you can see from my image - https://cloudup.com/c1FVuoETtyW

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

JamesW - one thing I have noticed in the Chrome Dev Tools about my custom styles versus the ones already in DMS is I see the name of my style.css file listed with my custom styles and for the DMS styles I see "?PageDraft=1:1".

 

http://www.screencast.com/t/IcA8C7GU

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks evscicats"] and @[member="Danny,

 

I did notice that which was kind of useful so I will take another look into it. Thanks to all for the help!

 

Cheers,

 

James

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

james - I would highly recommend you take a look at the Code School free course/interactive tutorial for Chromes developer tools, if you do and so some basic CSS tutorials, you will become a Chromes dev tools ninja in no time.

 

https://www.codeschool.com/courses/discover-devtools

1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Perfect, thanks a lot Danny I will certainly take a look at that course!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

No problem.

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