<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mohit Parmar</title>
    <description>The latest articles on DEV Community by Mohit Parmar (@mohitparmarcoder).</description>
    <link>https://dev.to/mohitparmarcoder</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4082181%2F04d113cb-b114-4f19-ad47-0c482e84bf94.jpg</url>
      <title>DEV Community: Mohit Parmar</title>
      <link>https://dev.to/mohitparmarcoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohitparmarcoder"/>
    <language>en</language>
    <item>
      <title>Your gradient button probably fails WCAG — mine hit 1.81:1</title>
      <dc:creator>Mohit Parmar</dc:creator>
      <pubDate>Tue, 18 Aug 2026 14:16:27 +0000</pubDate>
      <link>https://dev.to/mohitparmarcoder/your-gradient-button-probably-fails-wcag-mine-hit-1811-pni</link>
      <guid>https://dev.to/mohitparmarcoder/your-gradient-button-probably-fails-wcag-mine-hit-1811-pni</guid>
      <description>&lt;p&gt;My portfolio uses an indigo → violet → cyan gradient on headline words and primary&lt;br&gt;
buttons. It looks sharp. It also quietly failed accessibility, and no tool told me.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why checkers miss it
&lt;/h2&gt;

&lt;p&gt;WCAG AA wants 4.5:1 contrast between text and its background. Every contrast checker&lt;br&gt;
takes &lt;strong&gt;one&lt;/strong&gt; foreground and &lt;strong&gt;one&lt;/strong&gt; background colour. But white text on a gradient&lt;br&gt;
does not have one background — it has every colour along the ramp.&lt;/p&gt;

&lt;p&gt;So I computed the ratio at each gradient stop instead of eyeballing it:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Gradient stop&lt;/th&gt;
&lt;th&gt;White text contrast&lt;/th&gt;
&lt;th&gt;AA (4.5:1)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Indigo &lt;code&gt;#6366f1&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;4.6:1&lt;/td&gt;
&lt;td&gt;pass&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Violet &lt;code&gt;#8b5cf6&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;3.9:1&lt;/td&gt;
&lt;td&gt;fail&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cyan &lt;code&gt;#22d3ee&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.81:1&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;fail badly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;At the cyan end, white-on-cyan is nearly invisible to low-vision users — and this was&lt;br&gt;
the &lt;em&gt;call-to-action button&lt;/em&gt;. Worse, the hover state shifted the gradient toward cyan, so&lt;br&gt;
the button got less readable exactly when someone showed intent to click it.&lt;/p&gt;
&lt;h2&gt;
  
  
  The fix: two gradients with different jobs
&lt;/h2&gt;

&lt;p&gt;The display gradient is a brand asset; the button background is a legibility surface.&lt;br&gt;
Those are different jobs, so they got different ramps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;:root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c"&gt;/* Headline words only — never carries text on top of it. */&lt;/span&gt;
  &lt;span class="py"&gt;--gradient&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;110deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#6366f1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#8b5cf6&lt;/span&gt; &lt;span class="m"&gt;45%&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#22d3ee&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c"&gt;/* Filled surfaces carrying white text. Every stop clears 4.5:1. */&lt;/span&gt;
  &lt;span class="py"&gt;--gradient-solid&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;linear-gradient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;110deg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#4f46e5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;#7c3aed&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The display gradient survives untouched where it is safe — clipped &lt;em&gt;into&lt;/em&gt; text with&lt;br&gt;
&lt;code&gt;background-clip: text&lt;/code&gt;, where the text is the gradient rather than sitting on it. The&lt;br&gt;
solid ramp goes everywhere white text sits on a fill. Visually the two read as the same&lt;br&gt;
brand; mathematically only one of them ever carries text.&lt;/p&gt;

&lt;h2&gt;
  
  
  The habit worth keeping
&lt;/h2&gt;

&lt;p&gt;If a design uses gradients under text, check the ratio &lt;strong&gt;at every stop, in every&lt;br&gt;
state&lt;/strong&gt; — including hover — with a script, not a screenshot. It is ten lines of&lt;br&gt;
relative-luminance maths, and it catches the failure the single-pair checkers are&lt;br&gt;
structurally unable to see.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://mohitparmarcoder.github.io/Personal-Portfolio-Mohit-Parmar/writing/gradient-button-fails-wcag/" rel="noopener noreferrer"&gt;my portfolio&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>css</category>
      <category>wcag</category>
      <category>designsystems</category>
    </item>
    <item>
      <title>GITHUB_TOKEN cannot enable GitHub Pages — and neither error tells you that</title>
      <dc:creator>Mohit Parmar</dc:creator>
      <pubDate>Tue, 18 Aug 2026 14:16:26 +0000</pubDate>
      <link>https://dev.to/mohitparmarcoder/githubtoken-cannot-enable-github-pages-and-neither-error-tells-you-that-123c</link>
      <guid>https://dev.to/mohitparmarcoder/githubtoken-cannot-enable-github-pages-and-neither-error-tells-you-that-123c</guid>
      <description>&lt;p&gt;While deploying my portfolio to GitHub Pages with GitHub Actions, the very first run&lt;br&gt;
failed at &lt;code&gt;actions/configure-pages@v5&lt;/code&gt; with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Get Pages site failed. Please verify that the repository has Pages enabled
and configured to build using GitHub Actions ... Error: Not Found
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The message suggests a misconfigured workflow. It isn't. It means the Pages &lt;em&gt;site&lt;br&gt;
itself&lt;/em&gt; does not exist yet — nothing in the repository ever created it.&lt;/p&gt;
&lt;h2&gt;
  
  
  The trap: &lt;code&gt;enablement: true&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;The action has an input that sounds like the exact fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/configure-pages@v5&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;enablement&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This fails too, with a different but equally unhelpful error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create Pages site failed. Error: Resource not accessible by integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;"Resource not accessible by integration" is GitHub's way of saying the token you are&lt;br&gt;
using does not have the permission this API call needs. And here is the part that is&lt;br&gt;
genuinely not obvious: &lt;strong&gt;no permission you can grant in the workflow file fixes it.&lt;/strong&gt;&lt;br&gt;
Creating a Pages site is a repository-administration operation, and the automatic&lt;br&gt;
&lt;code&gt;GITHUB_TOKEN&lt;/code&gt; can never administer the repository — by design, no matter what you put&lt;br&gt;
under &lt;code&gt;permissions:&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;enablement&lt;/code&gt; input only works with a personal access token or a GitHub App token.&lt;br&gt;
For a personal project, wiring one up just for this is not worth it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The actual fix — thirty seconds, in a browser
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Settings → Pages → Build and deployment → Source → GitHub Actions.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That is the entire fix. It creates the Pages site once, and from then on the standard&lt;br&gt;
workflow — &lt;code&gt;configure-pages&lt;/code&gt; → &lt;code&gt;upload-pages-artifact&lt;/code&gt; → &lt;code&gt;deploy-pages&lt;/code&gt; — works with the&lt;br&gt;
default token forever.&lt;/p&gt;

&lt;p&gt;Two extra details that cost me time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A private repository on a free account cannot serve Pages at all.&lt;/strong&gt; Public repo, or
a paid plan. The errors will not tell you this either.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The GitHub mobile app has no Settings screen.&lt;/strong&gt; If you are doing this from a phone,
you need the browser, and probably "desktop site" mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I took from it
&lt;/h2&gt;

&lt;p&gt;When a CI error says "Not Found" about a resource your workflow is supposed to &lt;em&gt;create&lt;/em&gt;,&lt;br&gt;
ask whether creating it is an admin operation. The default Actions token deliberately&lt;br&gt;
cannot administer the repository that runs it — a good security boundary that produces&lt;br&gt;
two of the most misleading error messages I have hit this year.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://mohitparmarcoder.github.io/Personal-Portfolio-Mohit-Parmar/writing/github-pages-token-cannot-enable/" rel="noopener noreferrer"&gt;my portfolio&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>githubpages</category>
      <category>cicd</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
