<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>css &amp;mdash; Iman Codes</title>
    <link>https://iman.codes/tag:css</link>
    <description>sometimes it&#39;s fun</description>
    <pubDate>Fri, 17 Apr 2026 12:50:13 +0000</pubDate>
    <item>
      <title>WriteAs Comments - Talkyard</title>
      <link>https://iman.codes/writeas-comments-talkyard?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Might be a little silly to have a blog post about implementing comments on WriteAs when this blog itself doesn’t have comments implemented, but I thought I’d put it up here anyway. I have no idea how Javascript works so I only managed to get comments up on my personal blog thanks to various resources, specifically by Dino.&#xA;&#xA;But, it&#39;s code and should probably go up on the code blog!&#xA;&#xA;I wanted a lightweight, privacy-focused commenting system and didn&#39;t want to wait for Remark.as to be open for non-paying Write.as users. Also, I didn&#39;t want to pay through the nose for a system that will probably get like, 2 comments total over the lifetime of my blog. Plus I didn&#39;t want to host it myself, because it&#39;d probably be more of a hassle than it&#39;s worth!&#xA;&#xA;I tried out a couple options that were recommended on the Write.as discussion forums but in the end, I went with Talkyard.&#xA;&#xA;!--more--&#xA;&#xA;Getting the Javascript up and running was way easier when I could refer to Dino&#39;s implementation of Hyvor Talk, but it did take some finagling, since I don&#39;t really know what I&#39;m doing.&#xA;&#xA;A lot of the implementation methods for Write.as comments involved placing a code snippet at the bottom of each post, often with the Write.as signature function to make things easier - but that would also put comments onto pinned posts, which is sometimes not what you&#39;re going for. But Dino&#39;s code for Hyvor Talk was pretty elegant - it would automatically insert the code at the bottom of each post, eliminating the need to manually copy and paste it each time or use the signature function. He also had a way to exclude your pinned posts - that part would be manual, but one has way fewer pinned posts than regular blog posts!&#xA;&#xA;Anyway, something that I managed to do specifically for Talkyard is take the post slug and use it as the Talkyard ID. This means that as long as I don&#39;t change my post slug, I can automatically port my comments if I change the post title or domain name! Which is super convenient since I&#39;ll probably move off the writeas.com domain at some point for the personal blog - I just haven&#39;t committed yet.&#xA;&#xA;I think the script is relatively readable so I&#39;ve just copied and pasted it below:&#xA;&#xA;var currentURL = window.location.href;&#xA;var isAboutPage = /\/about$/i.test(currentURL);&#xA;var isArchivePage = /\/archive$/i.test(currentURL);&#xA;&#xA;var element = document.querySelector(&#39;meta[property=&#34;og:url&#34;]&#39;);&#xA;var content = element &amp;&amp; element.getAttribute(&#34;content&#34;);&#xA;var postSlug = content.split(&#39;/&#39;).pop();&#xA;&#xA;var talkyardServerUrl = &#39;server URL here&#39;;&#xA;&#xA;var talkyardDiv = &#39;brhrbrdiv class=&#34;talkyard-comments&#34; data-discussion-id=&#34;talkyardID&#34;/div&#39;&#xA;&#xA;talkyardDiv = talkyardDiv.replace(&#34;talkyardID&#34;, postSlug);&#xA;&#xA;if (document.getElementById(&#34;post-body&#34;) &amp;&amp; !isArchivePage &amp;&amp; !isAboutPage) {&#xA;    document.getElementsByTagName(&#34;article&#34;)[0].insertAdjacentHTML(&#39;beforeend&#39;, talkyardDiv );&#xA;}&#xA;&#xA;// src: https://c1.ty-cdn.net/-/talkyard-comments.min.js&#xA;&#xA;Looking at it now, I realize I haven&#39;t excluded my (empty) tags page from here, so maybe I&#39;ll do that... eventually... As an aside, I do like Write.as but there is a lot of manual work for some stuff. Its primary focus is writing and I appreciate it a lot, because it minimizes all the distractions that come from other blogging platforms! But that means it doesn&#39;t have a lot of stuff that comes out-of-box from other platforms too (see: this whole post about putting comments up lol).&#xA;&#xA;But moving on, I also customized the CSS for Talkyard to match my personal blog. That&#39;s actually why I haven&#39;t implemented it on this code blog, even though Talkyard allows you to put it on as many sites as you&#39;d like - the theming would clash completely! My personal blog is very bright and pink, while this one is cool blues. The default theme would&#39;ve actually been acceptable on the code blog, but as of now, without learning a whole lot more about Javascript and CSS, I don&#39;t think I&#39;d be able to have two separate themes.&#xA;&#xA;Talkyard says, on its CSS and Javascript page customization page:&#xA;&#xA;  We&#39;ll give you a simpler way to choose colors, later.&#xA;&#xA;so we&#39;ll see if that comes to fruition! My theming was a complete hack job, so I&#39;m looking forward to... not having it be a complete hack job, lol. And that&#39;s why I won&#39;t be sharing the CSS here.&#xA;&#xA;When I tested things out, it seemed to work really nicely. There’s some moderation features, which will be nice if I ever need that (hopefully not!). &#xA;&#xA;Anyway, hopefully this post will help me in the future, or if I’m really lucky, someone else trying to set up Talkyard on their own Write.as blog, haha.&#xA;&#xA;#javascript #css]]&gt;</description>
      <content:encoded><![CDATA[<p>Might be a little silly to have a blog post about implementing comments on WriteAs when this blog itself doesn’t have comments implemented, but I thought I’d put it up here anyway. I have no idea how Javascript works so I only managed to get comments up on my <a href="https://write.as/iman/" rel="nofollow">personal blog</a> thanks to <a href="https://discuss.write.as/t/adding-comments-to-your-blog/1146/16" rel="nofollow">various</a> <a href="https://discuss.write.as/t/installing-a-write-as-theme/4117/3" rel="nofollow">resources</a>, specifically by <a href="https://journal.dinobansigan.com/" rel="nofollow">Dino</a>.</p>

<p>But, it&#39;s code and should probably go up on the code blog!</p>

<p>I wanted a lightweight, privacy-focused commenting system and didn&#39;t want to wait for Remark.as to be open for non-paying Write.as users. Also, I didn&#39;t want to pay through the nose for a system that will probably get like, 2 comments total over the lifetime of my blog. Plus I didn&#39;t want to host it myself, because it&#39;d probably be more of a hassle than it&#39;s worth!</p>

<p>I tried out a couple options that were recommended on the Write.as discussion forums but in the end, I went with <a href="https://forum.talkyard.io/blog-comments" rel="nofollow">Talkyard</a>.</p>



<p>Getting the Javascript up and running was way easier when I could refer to Dino&#39;s implementation of Hyvor Talk, but it did take some finagling, since I don&#39;t really know what I&#39;m doing.</p>

<p>A lot of the implementation methods for Write.as comments involved placing a code snippet at the bottom of each post, often with the Write.as signature function to make things easier – but that would also put comments onto pinned posts, which is sometimes not what you&#39;re going for. But Dino&#39;s code for Hyvor Talk was pretty elegant – it would automatically insert the code at the bottom of each post, eliminating the need to manually copy and paste it each time or use the signature function. He also had a way to exclude your pinned posts – that part would be manual, but one has way fewer pinned posts than regular blog posts!</p>

<p>Anyway, something that I managed to do specifically for Talkyard is take the post slug and use it as the Talkyard ID. This means that as long as I don&#39;t change my post slug, I can automatically port my comments if I change the post title or domain name! Which is super convenient since I&#39;ll probably move off the writeas.com domain at some point for the personal blog – I just haven&#39;t committed yet.</p>

<p>I think the script is relatively readable so I&#39;ve just copied and pasted it below:</p>

<pre><code>var currentURL = window.location.href;
var isAboutPage = /\/about$/i.test(currentURL);
var isArchivePage = /\/archive$/i.test(currentURL);

var element = document.querySelector(&#39;meta[property=&#34;og:url&#34;]&#39;);
var content = element &amp;&amp; element.getAttribute(&#34;content&#34;);
var postSlug = content.split(&#39;/&#39;).pop();

var talkyardServerUrl = &#39;server URL here&#39;;

var talkyardDiv = &#39;&lt;br&gt;&lt;hr&gt;&lt;br&gt;&lt;div class=&#34;talkyard-comments&#34; data-discussion-id=&#34;talkyardID&#34;&gt;&lt;/div&gt;&#39;

talkyardDiv = talkyardDiv.replace(&#34;talkyardID&#34;, postSlug);


if (document.getElementById(&#34;post-body&#34;) &amp;&amp; !isArchivePage &amp;&amp; !isAboutPage) {
    document.getElementsByTagName(&#34;article&#34;)[0].insertAdjacentHTML(&#39;beforeend&#39;, talkyardDiv );
}

// src: https://c1.ty-cdn.net/-/talkyard-comments.min.js
</code></pre>

<p>Looking at it now, I realize I haven&#39;t excluded my (empty) tags page from here, so maybe I&#39;ll do that... eventually... As an aside, I do like Write.as but there is a lot of manual work for some stuff. Its primary focus is <em>writing</em> and I appreciate it a lot, because it minimizes all the distractions that come from other blogging platforms! But that means it doesn&#39;t have a lot of stuff that comes out-of-box from other platforms too (see: this whole post about putting comments up lol).</p>

<p>But moving on, I also customized the CSS for Talkyard to match my personal blog. That&#39;s actually why I haven&#39;t implemented it on this code blog, even though Talkyard allows you to put it on as many sites as you&#39;d like – the theming would clash completely! My personal blog is very bright and pink, while this one is cool blues. The default theme would&#39;ve actually been acceptable on the code blog, but as of now, without learning a whole lot more about Javascript and CSS, I don&#39;t think I&#39;d be able to have two separate themes.</p>

<p>Talkyard says, on its CSS and Javascript page customization page:</p>

<blockquote><p>We&#39;ll give you a simpler way to choose colors, later.</p></blockquote>

<p>so we&#39;ll see if that comes to fruition! My theming was a complete hack job, so I&#39;m looking forward to... not having it be a complete hack job, lol. And that&#39;s why I won&#39;t be sharing the CSS here.</p>

<p>When I tested things out, it seemed to work really nicely. There’s some moderation features, which will be nice if I ever need that (hopefully not!).</p>

<p>Anyway, hopefully this post will help me in the future, or if I’m really lucky, someone else trying to set up Talkyard on their own Write.as blog, haha.</p>

<p><a href="https://iman.codes/tag:javascript" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">javascript</span></a> <a href="https://iman.codes/tag:css" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">css</span></a></p>
]]></content:encoded>
      <guid>https://iman.codes/writeas-comments-talkyard</guid>
      <pubDate>Sun, 26 Feb 2023 17:45:34 +0000</pubDate>
    </item>
    <item>
      <title>tags</title>
      <link>https://iman.codes/tags?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[I try to tag my posts, and here they are, with a description of what they should contain:&#xA;&#xA;datascience&#xA;  as a data scientist, I do the data science-y things on a regular basis&#xA;&#xA;meta&#xA;  it&#39;s about this blog itself, or maybe about me, idk&#xA;&#xA;css&#xA;  it&#39;s about CSS, and probably about the blog style&#xA;&#xA;wids2021&#xA;  Women in Data Science 2021: all about the conference and the datathon&#xA; ]]&gt;</description>
      <content:encoded><![CDATA[<p>I try to tag my posts, and here they are, with a description of what they should contain:</p>

<p><a href="https://iman.codes/tag:datascience" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">datascience</span></a>
&gt; as a data scientist, I do the data science-y things on a regular basis</p>

<p><a href="https://iman.codes/tag:meta" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">meta</span></a>
&gt; it&#39;s about this blog itself, or maybe about me, idk</p>

<p><a href="https://iman.codes/tag:css" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">css</span></a>
&gt; it&#39;s about CSS, and probably about the blog style</p>

<p><a href="https://iman.codes/tag:wids2021" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">wids2021</span></a>
&gt; Women in Data Science 2021: all about the conference and the datathon</p>
]]></content:encoded>
      <guid>https://iman.codes/tags</guid>
      <pubDate>Fri, 22 Jan 2021 18:58:46 +0000</pubDate>
    </item>
    <item>
      <title>Stealing CSS</title>
      <link>https://iman.codes/stealing-css?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[If you consider website-making to be coding (and really, you should!), I&#39;ve been coding since like... grade 3? which was in the 90&#39;s. I was a teeny child, making an AngelFire website, complete with Pokémon gifs. Specifically, this one:&#xA;&#xA;Pikachu under construction gif&#xA;&#xA;Of course, there were other gifs as well. It was a) the era, and b) come on, I was like 9.&#xA;&#xA;Anyway, I&#39;ve been going back to my roots and playing with the CSS here, aka &#34;stealing&#34; code from elsewhere to make my site look half-decent haha.&#xA;&#xA;!--more--I&#39;m using the Narrow Road, Deep North theme from the Write.as theme gallery but am slowly making it my own. I&#39;ve also taken some of the CSS from Tea Time - mainly the link hover highlighting.&#xA;&#xA;But the code I&#39;m happiest about &#34;borrowing&#34; is the code blocks! Write.as is in Markdown and supports both inline code and code blocks, and has syntax highlighting through highlight.js. I was struggling to customize the code blocks though, and came across this blog post on how to change the highlight.js theme in Write.as, conveniently enough.&#xA;&#xA;Anyway, I did the thing (since the colours of Narrow Road, Deep North are based on the Nord colour theme, I of course used that one from the highlight.js themes). It somehow it wasn&#39;t still working - I couldn&#39;t get the language detection, and it wouldn&#39;t even do the plain text bit, so I decided to go, well, simpler. Changing the highlight.js theme didn&#39;t even change my inline code, so I had to get that anyway.&#xA;&#xA;I ended up on this article, where I kinda just... took things and only vaguely understood how it works. But hey, it works and I don&#39;t think anything looks too wonky! And if I do find something weird, I&#39;ll be more able to fix it. Plus, now I have the fancy CSS for my inline code and my plain code blocks:&#xA;&#xA;ooooh fancy, i&#39;m a code block&#xA;look at me be all code-y&#xA;And then I played around a bit more and did, in fact, get the syntax highlighting to work. Apparently the Markdown code blocks won&#39;t auto-detect language, so I have to be specific in the HTML. So here&#39;s the CSS for my inline and plain code blocks to show off the syntax highlighting bit:&#xA;&#xA;precode class=&#34;language-CSS&#34;/ &#xA;    oooh comments, look at me go&#xA;    also this is CSS for my inline and block code, formatted to work in write.as&#xA;&#xA;/&#xA;&#xA;pre {&#xA;  color: #eceff4;&#xA;  background: #2e3440 !important;&#xA;  border-radius: .5rem !important;&#xA;}&#xA;&#xA;p   code,&#xA;li   code,&#xA;dd   code,&#xA;td   code {&#xA;  color: #eceff4;&#xA;  background: #2e3440 !important;&#xA;  font-size: 0.9rem !important;&#xA;  padding: .2rem .3rem .2rem !important;&#xA;  border-radius: .2rem !important;&#xA;}/code/pre&#xA;&#xA;So there you have it. Mostly I wanted this up so if I do need to change my code blocks around, I can refer to this page and refresh as needed, haha.&#xA;&#xA;css]]&gt;</description>
      <content:encoded><![CDATA[<p>If you consider website-making to be coding (and really, you should!), I&#39;ve been coding since like... grade 3? which was in the 90&#39;s. I was a teeny child, making an AngelFire website, complete with Pokémon gifs. Specifically, this one:</p>

<p><img src="https://i.imgur.com/qW2Nn7x.gif" alt="Pikachu under construction gif"/></p>

<p>Of course, there were other gifs as well. It was a) the era, and b) come on, I was like 9.</p>

<p>Anyway, I&#39;ve been going back to my roots and playing with the CSS here, aka “stealing” code from elsewhere to make my site look half-decent haha.</p>

<p>I&#39;m using the <a href="https://write.as/themes/narrow-road-deep-north" rel="nofollow">Narrow Road, Deep North</a> theme from the Write.as theme gallery but am slowly making it my own. I&#39;ve also taken some of the CSS from <a href="https://write.as/themes/tea-time" rel="nofollow">Tea Time</a> – mainly the link hover highlighting.</p>

<p>But the code I&#39;m happiest about “borrowing” is the code blocks! Write.as is in Markdown and supports both <code>inline code</code> and code blocks, and has syntax highlighting through <a href="https://highlightjs.org/" rel="nofollow">highlight.js</a>. I was struggling to customize the code blocks though, and came across <a href="https://codequeen.io/how-to-change-code-syntax-highlighting-in-write-as" rel="nofollow">this blog post</a> on how to change the highlight.js theme in Write.as, conveniently enough.</p>

<p>Anyway, I did the thing (since the colours of Narrow Road, Deep North are based on the <a href="https://www.nordtheme.com/" rel="nofollow">Nord colour theme</a>, I of course used that one from the highlight.js themes). It somehow it wasn&#39;t still working – I couldn&#39;t get the language detection, and it wouldn&#39;t even do the plain text bit, so I decided to go, well, simpler. Changing the highlight.js theme didn&#39;t even change my inline code, so I had to get that anyway.</p>

<p>I ended up on <a href="https://css-tricks.com/styling-code-in-and-out-of-blocks/" rel="nofollow">this article</a>, where I kinda just... took things and only vaguely understood how it works. But hey, it works and I don&#39;t think anything looks too wonky! And if I do find something weird, I&#39;ll be more able to fix it. Plus, now I have the fancy CSS for my <code>inline code</code> and my plain code blocks:</p>

<pre><code>ooooh fancy, i&#39;m a code block
look at me be all code-y
</code></pre>

<p>And then I played around a bit more and did, in fact, get the syntax highlighting to work. Apparently the Markdown code blocks won&#39;t auto-detect language, so I have to be specific in the HTML. So here&#39;s the CSS for my inline and plain code blocks to show off the syntax highlighting bit:</p>

<pre><code class="language-CSS">/* 
    oooh comments, look at me go
    also this is CSS for my inline and block code, formatted to work in write.as

*/

pre {
  color: #eceff4;
  background: #2e3440 !important;
  border-radius: .5rem !important;
}

p &gt; code,
li &gt; code,
dd &gt; code,
td &gt; code {
  color: #eceff4;
  background: #2e3440 !important;
  font-size: 0.9rem !important;
  padding: .2rem .3rem .2rem !important;
  border-radius: .2rem !important;
}</code></pre>

<p>So there you have it. Mostly I wanted this up so if I <em>do</em> need to change my code blocks around, I can refer to this page and refresh as needed, haha.</p>

<p><a href="https://iman.codes/tag:css" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">css</span></a></p>
]]></content:encoded>
      <guid>https://iman.codes/stealing-css</guid>
      <pubDate>Mon, 18 Jan 2021 16:41:09 +0000</pubDate>
    </item>
  </channel>
</rss>