batarang icon indicating copy to clipboard operation
batarang copied to clipboard

[need guidance] how to fix CSS in js/services/appHighlight.js

Open maciejjankowski opened this issue 12 years ago • 5 comments

Hello from Poland!

warning! long post

I have made some styles batarang could use: image

It uses two selectors not one, class for element outline and class:before or class:after for element label. It is described here: http://www.b-good.pl/2013/08/25/showing-controllers-and-includes-in-angularjs-app/

Context

in appHighlight, there is a var with styles. For "app" we have:

    app: {
      selector: '[ng-app]',
      style: 'border: 1px solid green'
    }

and in appCss.js styleSheet.insertRule(args.selector + '{' + args.style + '}', styleSheet.cssRules.length);

Questions

  1. Instead of injecting CSS, can this be substituted to simply add a class from existing stylesheet? I could use jQuery addClass to fix it or any other suggested method. This would make it easier to maintain the CSS.
  2. If 1 doesn't seem like a good idea, point me in the direction how this could be implemented.
  3. What are the next steps? PR?

p.s. this would be my first OSS code contribution, so please be gentle.

maciejjankowski avatar Aug 28 '13 07:08 maciejjankowski

I :heart: this so much.

I'll take a look this afternoon and get back to you. Thanks!

btford avatar Aug 28 '13 07:08 btford

Let me know how to make this happen into batarang. I made a fork and I need some help in doing all the magic - I could do a quick and dirty solution but I'd like to do something better.

maciejjankowski avatar Aug 28 '13 18:08 maciejjankowski

hey @btford just updated the fork but I cant get controller highlighting to work. Can you take a look?

Once this works I will work on those styles

maciejjankowski avatar Aug 29 '13 21:08 maciejjankowski

Fantastic! Have you kept this up to date?

SomeKittens avatar Sep 30 '15 01:09 SomeKittens

it had been a while ;-)

I might need to take a look into that again.

maciejjankowski avatar Oct 08 '15 20:10 maciejjankowski