Re: Styles pane: create new rules in existing files rather than virtual inspector-stylesheet

151 views
Skip to first unread message

sabrina...@gmail.com

unread,
Apr 4, 2014, 2:08:18 AM4/4/14
to google-chrome-...@googlegroups.com, apa...@chromium.org
I also want this!! Dev tools is great for saving CSS but it doesn't really help if I can't add new rules directly to my files. Unless I'm missing something??

On Saturday, November 24, 2012 3:29:53 PM UTC-8, Nikita Vasilyev wrote:
I’m working on "Save CSS Rules added via Style pane" feature for Tincr. I want to create new style rules in existing CSS file rather than virtual inspector-stylesheet. I came up with a tiny extension which does what I need by copying inspector-stylesheet’s content to the actual CSS file, then flushing inspector-stylesheet.

Here is a screencast of it in action. As you can see on 6th second, it doesn’t work well. I cannot type the text since the inspector-stylesheet is already emptied but the styles pane hasn’t been updated. On 18th second you can see that switching to a different element and then back shows the updated CSS rule with the correct URL.

One possible solution would be to update the styles pane upon setContent. However, it should remain the focus on currently edited input (which might be tricky).

As a side issue, on 28th second you can see that resource.setContent('', false) does not update the file in the editor. Might be a bug.
Reply all
Reply to author
Forward
0 new messages