<p></p>
<blockquote>
<p dir="auto">When I'm refactoring, or when I'm reading pull requests, it's often unclear to me if particular html class names are still required.</p>
</blockquote>
<p dir="auto">Search for class name. If they weren't removed in a pull request, they are likely still required.</p>
<blockquote>
<p dir="auto">For example, in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1430552142" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/3779" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/3779/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/3779">#3779</a> the CSS rules for <code class="notranslate">.loader</code> were removed, but the class was still left in the html code in the .erb templates in the PR. I had to dig around to find out that there is still JavaScript code that needs those classes to remain.</p>
</blockquote>
<p dir="auto">You can easily find them with a <code class="notranslate">.loader</code> search. <code class="notranslate">loader</code>/<code class="notranslate">loader_copy</code> classes still exist because there are about five different methods currently in use to place spinners. I want to replace them with one method (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1430552142" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/3779" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/3779/hovercard?comment_id=1317291481&comment_type=issue_comment" href="https://github.com/openstreetmap/openstreetmap-website/pull/3779#issuecomment-1317291481">#3779 (comment)</a>).</p>
<blockquote>
<p dir="auto">I think that we should follow the convention to prefix all the classes used in our Javascript with <code class="notranslate">js-</code>.</p>
</blockquote>
<p dir="auto">Initially I wanted to say that since you don't like custom css, the only non-bootstrap classes should be the ones used in javascript. Then why don't you propose to prefix those temporary css-only classes instead? But then you wrote <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1430552142" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/3779" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/3779/hovercard?comment_id=1318600407&comment_type=issue_comment" href="https://github.com/openstreetmap/openstreetmap-website/pull/3779#issuecomment-1318600407">#3779 (comment)</a> so, I guess, javascript-used classes are also bad? Or are they only bad when added/removed?</p>
<blockquote>
<p dir="auto">Github has a nice explanation in their eslint rule... "JavaScript should only query and handle events for js- prefixed class names."</p>
</blockquote>
<p dir="auto">Are they also against custom css?</p>
<p dir="auto">So instead of this:</p>
<pre class="notranslate"><code class="notranslate"><button type="button" class="btn-close" ...>
</code></pre>
<p dir="auto">write this:</p>
<pre class="notranslate"><code class="notranslate"><button type="button" class="btn-close js-btn-close" ...>
</code></pre>
<p dir="auto">?</p>
<p dir="auto">Do you want to prefix ids too? How something like this should look like</p>
<pre class="notranslate"><code class="notranslate">$("#sidebar .search_form input[name=query]")
</code></pre>
<p dir="auto">?</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3801#issuecomment-1319921663">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPKSWW7ORV7CT3BOKDWI5XONANCNFSM6AAAAAASCM525A">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPFI6RY4H3Z6H2AAGDWI5XONA5CNFSM6AAAAAASCM525CWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSOVRT76.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/3801/1319921663</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3801#issuecomment-1319921663",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3801#issuecomment-1319921663",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>