dvargas92495/roamjs-com

Serendipity - Add CSS class

LaurenaRehbein opened this issue · 5 comments

I'm enjoying the Serendipity extension but would like to be able to edit the CSS for the output. Would it be possible to add CSS selectors to the Label, etc?

The label is just a Roam tag, so it should already be selectable with CSS

@dvargas92495 I was trying to do that, but don't see anything that is unique to the generated block, and is standard each day:

https://d.pr/i/JyuFAs
Full Image: https://d.pr/i/JyuFAs

Am I missing it?

Maybe added here?

https://github.com/dvargas92495/roam-js-extensions/blob/master/src/entries/serendipity.ts#L354

const container = b.closest(".rm-block-main");

Could become:

const container = b.closest(".rm-block-main .rm-block-serendipity");

I am only a beginner coder but would be happy to set this up as a PR if I am on the right track here.

ah you are using a plain text label. If you use a tagged reference, you'd be able to select it, like #Thoughts:

image

The block isn't generated by RoamJS, just written to Roam itself. the line you referenced wouldn't add a selector, it's simply looking for the block with that selector. closest is a GET not a WRITE

Ah, got it! Thank you! Marking as Closed.