Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Add a new CSS rule in safari 6?

I upgraded to Safari 6 about 3 months ago and was preplexed that I couldnt figure out how to add a new css rule in the web inspector. It used to be there was a menu that had the option to "add new css rule". Since this is kind of a dealbreaker for me in my development process, I have moved to using Chrome for the past coulple of months.


But this is really bugging me as there has to be a way to do this. Does anyone know. What am I missing.


The documentation for safari says that this option is in the gear menu but I don't have a gear menu? Am I missing something? (see screenshot below)User uploaded file


And here is a screenshot of my inspector window. I don't see the gear menu.

User uploaded file


I am wondering if I have a bad install or something.


Thanks for the help!

Mac Pro, OS X Mountain Lion (10.8.2)

Posted on Feb 21, 2013 10:42 AM

Reply
17 replies

Feb 27, 2013 7:50 AM in response to shroom24

Ah. I see what you mean. I checked the Safari developer forums and there is a similar question there with no response.


I guess I don't see why this would be a "dealbreaker". It seems like few people have even noticed its absence and few of those care about it. I have been developing web sites exclusively in Safari for years and never knew I could do this and didn't notice that I had lost a capability I had never used. It seems like a trial and error approach that is really not necessary.

Feb 27, 2013 12:26 PM in response to etresoft

I don't mean to be rude, but just because you dont' find it useful absolutely does not mean that others don't.


I use this as an essential part of my development workflow, to test rules before actually adding them to the site. My process of adding css is quite involved and takes many steps as I am working in a quite large enterprise environment. Before I add a new rule, I test to see if it has unintended consequenses on other elements.


This is a dealbreaker for me. Since I upgraded Safari a couple of months ago, I switched to Chrome.


Safari's new developer tools are difficult to use and I haven't seen any benefit from the changes they made other than I had to take time out of my billing schedule to re-learn how to use them. I really haven't taken the time so I admit I am not an expert. They seemed so foreign from previous versions that I just gave up and moved to Chrome.


I am sure many others ran into this as well and I am guessing that most of them just figured it wasn't worth it when Chrome continues to make important improvements to their developer tools.


It just makes me sad to see Apple loosing their edge on usability and design. They used to be the leaders!

Feb 27, 2013 5:44 PM in response to Jessek

Jessek wrote:


I don't mean to be rude, but just because you dont' find it useful absolutely does not mean that others don't.

That's not rude. It is a valid point. My point was that, even though useful, it is not required or even noticed by most people. Why is that? Is there a better way of using Safari that you don't know about because to switch to Crhome so you could continue your prior workflow?


I use this as an essential part of my development workflow, to test rules before actually adding them to the site. My process of adding css is quite involved and takes many steps as I am working in a quite large enterprise environment. Before I add a new rule, I test to see if it has unintended consequenses on other elements.

Why don't you just add them to your development site? That seems far easier and less dangerous.


This is a dealbreaker for me. Since I upgraded Safari a couple of months ago, I switched to Chrome.


Safari's new developer tools are difficult to use and I haven't seen any benefit from the changes they made other than I had to take time out of my billing schedule to re-learn how to use them. I really haven't taken the time so I admit I am not an expert. They seemed so foreign from previous versions that I just gave up and moved to Chrome.


I am sure many others ran into this as well and I am guessing that most of them just figured it wasn't worth it when Chrome continues to make important improvements to their developer tools.

I have seen a total of two people who even noticed this, and I wasn't one of them. If you are developer, you have to be willing to adapt. Software changes. Chrome will change too. What will you do then?


I checked the Safari extensions page and there seem to about half a dozen developer extensions that will do what you ask.

Feb 28, 2013 9:37 AM in response to etresoft

You are right, I probably don't know all of the features of Safari due to my switch to Chrome, can you enlighten me on some what I might have missed in the upgrade to Safari 6?


I have to say that I did about a 3 hour search before moving to Chrome to see if there was something I might have been missing, and I had a real hard time finding any usable info from Apple or anyone else. That was about 3 months ago, perhaps there might be more out there now.


Of course I make all my changes in a dev environment, I am working in an enterprise network. I am working virtual environment and have to go through a 10 minute process to deploy any changes on that environment. That is why I test locally in the browser first, to save time. I would never make changes in a prod environment.


I guess if there are that many plugins, there must be more people than just me that want and use this feature.


Thanks for the heads up, I'll look for the plugins and look forward to hearing more about Safari's advancements in Safari 6. Until that time, I will be working in Chrome.

Feb 28, 2013 3:37 PM in response to Jessek

If you want to know what is new in Safari, I suggest you check the What's New in Safari 6 page. Note that in Safari 6 "Web Inspector has a streamlined new design that speeds up common development tasks". If that is insuffcient, you might want to consider joining the free Safari Developer Program.


Most HTML debugging efforts these days are focused on Javascript and removing, not adding CSS.

Feb 28, 2013 3:57 PM in response to etresoft

Yea that page has almost absolutely no information on the web inspector. It says things like the most advanced inspector yet, but doesn't tell you what is advanced about it or how to use it better. This is just marketing promotional copy. It doens't actually tell you anything other than it is way cooler!


Yea you are right, I guess I should join the free developer program. I think I was running into this when I was trying to get more info. I really don't understand why I have to register to get simple information about how to use the browser better.


I am sorry but I just don't understand what you are saying about removing css and adding javascript. How can you make such huge generalizations like that? Doesn't make any sense to me.


But that is my opinion and that is yours!


We all come from different backgrounds and have different needs. And perhaps you are right, maybe I am the only one that wants to edit my css in the browser, but then I prefer to work with a application that is built by a company that considers my needs.


As a side note, I am not the only one running into these problems. You can see other message board discussions about this with literally hundereds of posts. https://discussions.apple.com/thread/4158378?start=15&tstart=0

Feb 28, 2013 5:43 PM in response to Jessek

Jessek wrote:


Yea that page has almost absolutely no information on the web inspector.


Navigators

Navigators appear on the left side of the Web Inspector. Navigators show resources for your page, cookies and storage used, instruments for performance measurement, a central search interface, issue tracking, the debugging stack trace, active and inactive breakpoints, and a collection logs for each reload. Hot keys make switching between navigators fast.


Jump Bar

The Jump Bar at the top of the Web Inspector shows the location of your current view. Click any location in the bar to jump to any other element at that level.


Instrument navigator

You can now see the bigger picture when tracking down page performance issues. A single timeline shows you network loads, page layout and rendering, and JavaScript activity.


View Source

Select Show Page Source in the Develop menu to open the new Web Inspector and go straight to the source code. Enjoy the full benefits of syntax highlighting and link-based navigation to referenced sub resources.


Streamlined debugging

With the new Web Inspector, you can jump right in and start debugging and profiling JavaScript — everything is ready to go.


Quick Console

The Quick Console is always available at the bottom of the Web Inspector for your JavaScript expressions. JavaScript you type is evaluated, with the results displayed above on a scrolling ticker-tape.



That is almost absolutely nothing?


Yea you are right, I guess I should join the free developer program. I think I was running into this when I was trying to get more info. I really don't understand why I have to register to get simple information about how to use the browser better.


That's life - nasty, brutish, and short.


I am sorry but I just don't understand what you are saying about removing css and adding javascript. How can you make such huge generalizations like that? Doesn't make any sense to me.


Adding code adds complexity. Removing code reduces complexity.


We all come from different backgrounds and have different needs. And perhaps you are right, maybe I am the only one that wants to edit my css in the browser, but then I prefer to work with a application that is built by a company that considers my needs.


Your needs or your habits? Apple know what features people are using and what features they aren't. If there is something that people aren't using Apple will remove it to reduce complexity. You can add it back in with some 3rd party tool if you want, but then it is your responsibility.


As a side note, I am not the only one running into these problems. You can see other message board discussions about this with literally hundereds of posts. https://discussions.apple.com/thread/4158378?start=15&tstart=0

That is a five page thread of people complaining about the new web inspector. Not a single one of them mentioned the inability to inject new styles into a page.

Feb 28, 2013 6:02 PM in response to etresoft

You know absolutely nothing about how I work, what I work on or the quality of my work, yet you seem to know that what I am doing is incorrect.


Instead of answering a question you decide to try and demean the person and tell them the way they are doing something is wrong. How do you know anything about my habits or my development workflow?


Effective but not helpful.


I have not insulted you (or at least I don't think I have unless you are a member of the Safari team) and tried to demean how you decide to work.


Tell me gain now Apple knows how I am using something?


Adding css often is not about complexity but removing the need to add Javascript which defintiely increases complexity and slows browsers down. Hence why the W3c is contantly adding features to html and css to reduce the need of trying to hack functionality with javascript.


Again, I will bring us around to my original question. This feature is in the documentation that I have posted a screenshot of in my original post.


If Apple intended to remove it, why is it still in the documentation?

Feb 28, 2013 6:52 PM in response to Jessek

If Apple intended to remove it, why is it still in the documentation?

Unfortunately this looks like one of those cases where the documentation didn;t keep up with the code changes.


I could find no way to get a new rule to be accepted as such. You can edit the html and add styles in-line but that's not quit the same thing. I was hoping that by editing the html and adding the rule it would be picked up and added to the sidebar but no dice.


If you haven;t already you should send feedback to Apple regarding this.


regards

Feb 28, 2013 6:55 PM in response to Jessek

Jessek wrote:


You know absolutely nothing about how I work, what I work on or the quality of my work, yet you seem to know that what I am doing is incorrect.


Instead of answering a question you decide to try and demean the person and tell them the way they are doing something is wrong. How do you know anything about my habits or my development workflow?


I've been programming for a long time and I can tell when things don't add up.


If you recall, I did answer your question. I answered it incorrectly because I had no idea what you were talking about. I have not demeaned or insulted you in any way. If you disagree, you are welcome to post a complaint about me in the Using Apple Support Communities forum. There is a "Report post" button but you don't have enough points to enable that feature.


What I have done is suggest that the fact you are blocked by a feature that I never knew existing indicates a big problem. Such things shouldn't block you. If they do, your career is likely to be very short.


Adding css often is not about complexity but removing the need to add Javascript which defintiely increases complexity and slows browsers down. Hence why the W3c is contantly adding features to html and css to reduce the need of trying to hack functionality with javascript.

CSS has nothing to do with Javascript. I used Javascript as an example of the kinds of debugging work that Safari 6 has been designed to perform. There is nothing about Javascript that is a "hack" of functionality. Javascript is essential for modern, interactive web sites.


Again, I will bring us around to my original question. This feature is in the documentation that I have posted a screenshot of in my original post.


If Apple intended to remove it, why is it still in the documentation?

Because that is just the way programming life is sometimes.


I am not trying to insult you. I am trying to help. If you have selectors without matching rules, just add empty rules for them. It sounds like your site is way too complex. It also sounds like you are mixing your content and display properties. That is not the intent of CSS. Your HTML should be as absolutely simple as possible. Class names should semantically correspond to the underlying data and have nothing to do with how that data is displayed. If you do that, then it should be impossible to get into the state you are now in.

Add a new CSS rule in safari 6?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.