Avatar of oo7ml
oo7ml

asked on 

CSS Input

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.
CSSWeb DevelopmentWeb Browsers

Avatar of undefined
Last Comment
Julian Hansen
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

In Firefox you can do this with the Inspect Element option - see screenshot below User generated image
Avatar of oo7ml
oo7ml

ASKER

Thanks, that's exactly what i am looking for. Do you know if it is possible in Chrome?
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

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
Avatar of oo7ml
oo7ml

ASKER

Great, thanks... i'll take a look into this.
Avatar of Brandon Lyon
Brandon Lyon

There's a plugin named stylish which does what you mention. It's also available in Firefox.
Avatar of oo7ml
oo7ml

ASKER

Great, thanks... i'll look into this now... can you save changes (html & css)?
Avatar of Brandon Lyon
Brandon Lyon

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.
Avatar of oo7ml
oo7ml

ASKER

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.
Avatar of Brandon Lyon
Brandon Lyon

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.
Avatar of oo7ml
oo7ml

ASKER

I use brackets but it's working outside of the browser.
Avatar of Brandon Lyon
Brandon Lyon

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.
Avatar of oo7ml
oo7ml

ASKER

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.
Avatar of Brandon Lyon
Brandon Lyon

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.
Avatar of oo7ml
oo7ml

ASKER

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
SOLUTION
Avatar of Brandon Lyon
Brandon Lyon

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

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.
Avatar of oo7ml
oo7ml

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Web Development
Web Development

Web development includes all aspects of presenting content on intranets and the Internet, including delivery development, protocols, languages and standards, server software, browser clients, databases and multimedia generation.

77K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo