-
Notifications
You must be signed in to change notification settings - Fork 456
Code View on Pattern Detail Page #23
Comments
I created a feature branch for this this morning. Good news and bad news. The good news is that I integrated CSS Rule Saver quickly... the bad news is that it takes two seconds to generate PL when saving the CSS rules. Waiting two seconds for a simple refresh when using the watcher seems like a bad idea if the CSS output isn't going to be used. So I was thinking that we'd have a default code view that was lineage and mark-up. If someone needed the rules they could set a flag that caused PL to generate that as well and it would then get put into code view. I figure this would only happen near the end of a project. A useful feature but a performance hog. I was also thinking of using prism.js in the pop-up window for styling. |
Yeah, I think at the end of the day we have to be mindful of performance more than anything. I like the idea of having it as a feature flag, but honestly I'm happy to punt on this as there are a lot of other ways to inspect styles. Another thing I remember was someone talking about commenting CSS, and using that as a flag to spit out into the pattern. So something like:
Pattern Lab would then associate whatever's in between those comments with the appropriate molecule/organism/whatver. Again, I say we defer this for a later date, but definitely good to think about how this could be accomplished. |
Ok, I'll focus on the other. The use case I had in mind was a code repository (came up here) where we'd want to make assets easily copy-able. Not just for inspecting. The commenting CSS idea sounds really fragile. |
I get a little nervous having Pattern Lab become a code repository. There are lots of other tools that do that sort of thing way better, and I feel like if we were to go down that route, it would be a whole lot of work. I've seen companies using JS Bin internally to manage their production code modules, and that seems to work pretty well. I don't think it makes logistical sense for Pattern Lab to try to do double duty in that respect. |
Code view on the list views and pattern detail view is now sort of working in
I didn't test this overly much. Just make sure to clear your cache and generate your PL site. The header pattern is probably the best use case when testing. |
Tried to tackle the linking. Works on list view. Can't really test on the pattern detail view. |
Feature is live. |
Code view is currently available on the view all page, but isn't functional on pattern detail pages.
Code view will include the markup, and will present all CSS affecting the module.
The text was updated successfully, but these errors were encountered: