Skip to content

Commit a7c63f7

Browse files
NicolappsConvex, Inc.
authored and
Convex, Inc.
committed
Avoid elements being incorrectly blocked by Brave (#36513)
EasyList Cookie, the blocking list used by Brave to block cookie notices, [blocks elements with `.bottom-4` on convex.dev](https://github.com/easylist/easylist/blob/54378db24d7c56f0bf488d7b7825966d9f4a573e/easylist_cookie/easylist_cookie_specific_hide.txt#L3471), presumably to block the cookie notice component on website/docs that uses this class. As a consequence of this, all elements in the dashboard using `.bottom-4` are currently blocked by Brave by default. I’m creating a class with a different name to avoid breaking some dashboard features for Brave users. This PR also adds an ESLint rule to make sure we won’t use `.bottom-4` somewhere else by mistake. GitOrigin-RevId: ccaa22670e143f19edc0b1836092a68030d98104
1 parent 28a542f commit a7c63f7

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

npm-packages/dashboard-common/.eslintrc.cjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ module.exports = {
118118
message: "Don't use background colors for text",
119119
selector: "Literal[value=/^text-background-.*$/i]",
120120
},
121+
{
122+
message:
123+
".bottom-4 is blocked on convex.dev by easylist_cookie; use .bottom-four instead",
124+
selector: "Literal[value=/bottom-4(?:\\D|$)/i]",
125+
},
121126
],
122127
// allow (_arg: number) => {}
123128
"@typescript-eslint/no-unused-vars": [
@@ -166,6 +171,13 @@ module.exports = {
166171
// Makes it harder to accidentally fire off a promise without waiting for it.
167172
"@typescript-eslint/no-floating-promises": "error",
168173
"no-void": "off",
174+
175+
"tailwindcss/no-custom-classname": [
176+
"error",
177+
{
178+
whitelist: ["bottom-four"],
179+
},
180+
],
169181
},
170182
overrides: [
171183
{

npm-packages/dashboard-common/src/styles/globals.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,10 @@ body {
127127
@apply border-b;
128128
}
129129
}
130+
131+
@layer utilities {
132+
/* Alias for .bottom-4 to avoid false positives with easylist_cookie */
133+
.bottom-four {
134+
@apply bottom-4;
135+
}
136+
}

npm-packages/dashboard/src/components/billing/TeamUsageByFunctionChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function TeamUsageByFunctionChart({
129129

130130
{!showAll && nonZeroRows.length > ITEMS_SHOWN_INITIALLY && (
131131
<div className="h-4">
132-
<div className="pointer-events-none absolute bottom-4 h-24 w-full bg-gradient-to-b from-transparent to-background-secondary" />
132+
<div className="bottom-four pointer-events-none absolute h-24 w-full bg-gradient-to-b from-transparent to-background-secondary" />
133133
<div className="absolute bottom-0 left-[50%]">
134134
<Button
135135
className="-translate-x-1/2"

npm-packages/dashboard/src/elements/CommandPalette.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function DeleteProjectsPage({ onClose }: { onClose: () => void }) {
188188
<Command.Item
189189
className={cn(
190190
buttonClasses({ size: "xs", variant: "neutral" }),
191-
"absolute bottom-4 right-4 z-20 flex items-center gap-4 text-xs",
191+
"absolute bottom-four right-4 z-20 flex items-center gap-4 text-xs",
192192
)}
193193
data-button
194194
onSelect={handleDeleteProjects}

0 commit comments

Comments
 (0)