CSS Input

oo7ml
oo7ml used Ask the Experts™
on
Hi,

Does anyone know if there is any tool (probably a Chrome extention), that will allow you to inject a css sheet (stored on your server), into another site, for viewing purposes only.

I update / redesign a lot of different sites for my clients. I usually start by opening their site in Chrome and using the inspector to change a few things around in front of the client... however as soon as i close the tab, the changes are lost... so i'd like to be able to save the CSS code to a input-style.css file and save it to my server and then 'inject' it into my client's site for demonstration purposes.

Thanks in advance for your help.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
In Firefox you can do this with the Inspect Element option - see screenshot below screenshot

Author

Commented:
Thanks, that's exactly what i am looking for. Do you know if it is possible in Chrome?
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Not sure about chrome - I did find this though

https://developer.chrome.com/extensions/manifest/web_accessible_resources

And this

https://developer.chrome.com/extensions/tabs#method-insertCSS

Which talk about injecting CSS into the page
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Great, thanks... i'll take a look into this.
Brandon LyonWeb Developer/Designer

Commented:
There's a plugin named stylish which does what you mention. It's also available in Firefox.

Author

Commented:
Great, thanks... i'll look into this now... can you save changes (html & css)?
Brandon LyonWeb Developer/Designer

Commented:
I don't think stylish works with HTML. In chromes developer tools there may be something like that but I don't know since I haven't used such a feature. What are you trying to accomplish? There may be another way to do it which works better.

Author

Commented:
Thanks Brandon.

Basically i spend a lot of time, editing CSS and HTML live on a website in front of a client, using Inspect Element on Google Chrome.

This allows me to change the colors of various part's of a client's website in front of them so that i can direct feedback on the changes they want.

Obviously as soon as move away from the page or refresh the page, the changes are lost... i'll love to be be able to save the changes to a 'browser css file' as such so that anytime the page is loaded i can turn this on and off to inject CSS and HTML.
Brandon LyonWeb Developer/Designer

Commented:
There are text editors such as brackets.io which will automatically reload a page when you save a local file.  I believe you can use them to inject css or possibly html.

Author

Commented:
I use brackets but it's working outside of the browser.
Brandon LyonWeb Developer/Designer

Commented:
Here is a link from the brackets github which goes over the live-preview functionality.
https://github.com/adobe/brackets/wiki/How-to-Use-Brackets#live-preview

If you can't get it working, there are plugins which add similar functionality to the atom.io editor.

Author

Commented:
Thanks Brandon. Sorry i don't think i am explaining myself correctly.

If a new client loads their existing site in a browser (as normal)... i'd like to be able to 'CSS & HTML' hack it with them live, so they can see the suggestions i am making.

I'd then like to be able to save the changes i made so that i can 'inject' them into the webpage again if i load the website into a new tab.
Brandon LyonWeb Developer/Designer

Commented:
It's not really feasible to load a server-side stylesheet into a random website, but only for one person.

The options I see are as follows:

1) Develop on a secondary server which is a copy of the first, modify the copy, and share the URL with them (this is industry standard practice).

2) You can use a screen sharing tool such as Google Hangouts so that they can see the changes you are making on your side.

3) Give the client a javascript they can paste into the developer tools console which will fetch a remote stylesheet and append it to the page (clients usually don't like doing this kind of stuff).

I highly recommend that you use revision control such as git. This will allow you to easily save a local set of changes and then push them to somewhere else. It will also make it easy to clone copies of your websites. As an added bonus you will get a revision history which makes it easy to revert changes.

Author

Commented:
I don't think you understand me still (sorry i am probably explaining it poorly :-)

From time to time i meet with various clients and they show me sites they like, but they always want to suggest tweaking certain aspects of sites the like.

I like to open any site they choose in Chrome, right click on the area they are talking about, and then click Inspect Element... this allows me to edit the CSS & HTML live in the browser.

This is only for prototype / wireframing... however i would like to be able to save the HTML / CSS hack
Brandon LyonWeb Developer/Designer
Commented:
It won't be a 100% copy but you can right click on the page, save as, and then open the saved version in a new browser tab. Then you can edit the source files using whatever editor you want (there are even browser plugin editors such as Quickfire). That sounds like it's going to be the closest I can get you to what.
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Here is what I do.

I edit the CSS in Firebug using the CSS window. I choose the .css file I want to edit and make the modifications to it.

When I am done I copy the content and paste to a new file.  If you work within the CSS tab - not the Style pane on the right of the HTML window - you get the entire CSS file this way - not just the contextual CSS relative to the highlighted element.

Author

Commented:
Thanks guys. This is what i am referring too. I am surprised there isn't a plugin that allows you to capture / save the changes you made.
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
I am surprised there isn't a plugin that allows you to capture / save the changes you made.
Giving a plugin writes to save to disk is a potential security risk. The only thing I would change is the Firebug - open in editor - where it opens the current style sheet in its changed form rather than the original. A highlight cut and paste though is a couple of keystrokes more.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial