Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Retain id's and class Names #25

Open
RasPat1 opened this issue Apr 11, 2014 · 14 comments
Open

Add Option to Retain id's and class Names #25

RasPat1 opened this issue Apr 11, 2014 · 14 comments

Comments

@RasPat1
Copy link

RasPat1 commented Apr 11, 2014

Occasionally life becomes easier if you retain the names rather than renaming everything to DIV_1 and the like. This simple feature would make SS useful for a new category of use cases.

@RasPat1
Copy link
Author

RasPat1 commented Apr 11, 2014

Can I be assigned this one?

@kdzwinel
Copy link
Owner

Sounds great!

Couple of my thoughts and tips:

  • you'll still have to give IDs to the elements that don't have them
  • we need to check if ID isn't already used - we can't assume that HTML code is valid and IDs aren't duplicated
  • keeping class names should be as simple as chaning configuration of htmlClean plugin ( https://github.com/kdzwinel/SnappySnippet/blob/master/js/panel.js#L213 )
  • there is an (optional) ID prefixing feature - you'll need to make sure that it works with your changes
  • Snapshooter (https://github.com/kdzwinel/SnappySnippet/blob/master/js/tools/Snapshooter.js) is responsible for creating and setting IDs, you'll probably need to make most of the changes there.
  • I think that this new behaviour might be a default one. Making it optional (via 'Advanced settings') would be troublesome since Snapshooter sets the IDs and there is no easy way to change them afterwards.

For some reason I can't assign you to this task (do I have to add you to the project somehow?), but please feel assigned :) Also, feel free to ask me about anything - I'll be glad to help.

@kdzwinel
Copy link
Owner

Note to self - getMatchedStylesForNode ( https://chromium.googlesource.com/chromium/blink/+/master/Source/devtools/protocol.json ).

@udarts
Copy link

udarts commented Nov 3, 2015

Is there any news about this? I would like to know this as well.

@pradt
Copy link

pradt commented Jan 27, 2016

Is there any news on this ? I'd like it to retain class names.

@azachar
Copy link

azachar commented Mar 9, 2016

💯

@vongoh
Copy link

vongoh commented May 27, 2016

+1!

@RasPat1
Copy link
Author

RasPat1 commented Jun 1, 2016

There's a PR for this. That does the bare minimum to get some of the functionality I was looking for. Open to improvements.
#44

@mattdanna
Copy link

+1

1 similar comment
@calderJamNet
Copy link

+1

@RasPat1
Copy link
Author

RasPat1 commented Aug 11, 2016

@kdzwinel Have you taken a look at this?

@kdzwinel
Copy link
Owner

Not yet, sorry. I'll try to take a look at this in the following week.

On Thu, Aug 11, 2016 at 5:16 PM, Rasesh Patel [email protected]
wrote:

@kdzwinel https://github.com/kdzwinel Have you taken a look at this?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#25 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA8JoG-RmkN53vkN-iahpmacJuz2NSnwks5qezzBgaJpZM4Bxvu7
.

@inspiredearth
Copy link

Is there any update on this? I'd also love to see this enhancement made to SnappySnippet

@philly-vanilly
Copy link

philly-vanilly commented Nov 23, 2018

Just use the Chrome plugin "CSS Used". It does exactly what you need if you want to quickly copy styles into another framework or for similar use cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants