Hi all,
Here’s an easy way to get the css path to an element :
Open the inspect element tool : ctrl+shift+c (firefox/chrome) , then select the element you want to inspect
You can also do a right-click>inspect
The element will be highlighted in the dev tool pannel that shows up. Make sure this is the correct element (sometimes it can be nested inside the element inspected), then right click on the highlighted element > copy > copy selector or copy css path. This will give a selector css for the element.
This doesnt always give you the selector you need, for example if you do that with chrome on the text area of a tiddler, in edit mode , you will get :
body > textarea
This is because the textarea is in an iframe, which is treated like a separate document by the browser. In this case, just select the iframe that contains the element and you’ ll get this :
body > div.tc-page-container-wrapper > div > div > div > section > div.tc-tiddler-frame.tc-tiddler-edit-frame.tc-tiddler-exists> span > span > div:nth-child(5) > div > iframe
This rule is very specific and can be generalized with a bit of clean up :
.tc-tiddler-edit-frame iframe
Now if you look closely at the html, you’ll see that the iframe actuall has several class(tc-edit-texteditor and tc-edit-texteditor-body), but for some reason chrome doesnt copy those. So if we correct this, we get :
.tc-tiddler-edit-frame .tc-edit-texteditor.tc-edit-texteditor-body {… your rules css here …}
See Page Inspector - Firefox Developer Tools | MDN and View and change CSS - Chrome Developers for more info on the dev tools, and CSS: Cascading Style Sheets | MDN to learn more about CSS