Skip to content

Commit

Permalink
fix(explorer): scrollbar issues in firefox (#5322)
Browse files Browse the repository at this point in the history
* fix(explorer): scrollbar issues in firefox

* fix: improve themed styles

* feat: changeset
  • Loading branch information
VmMad authored Feb 12, 2025
1 parent 73bb2a6 commit c0ef9f2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/flat-suits-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@iota/apps-ui-kit': patch
---

Update scrollbar styles for firefox and add firefox only class selector
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function CoinsPanel({ coinType, id }: CoinsPanelProps): JSX.Element {

return (
<div className="max-h-[230px] overflow-auto">
<div className="flex flex-col flex-wrap gap-xs" ref={coinsSectionRef}>
<div className="flex flex-col flex-wrap gap-xs firefox:pr-xs" ref={coinsSectionRef}>
{data &&
data.pages.map((page) =>
page.data.map((coin) => (
Expand Down
13 changes: 13 additions & 0 deletions apps/ui-kit/src/lib/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@
}
}

@-moz-document url-prefix() {
* {
scrollbar-width: thin;
scrollbar-color: theme('colors.neutral.30') transparent;
}

:root:not(.dark) {
* {
scrollbar-color: theme('colors.neutral.80') transparent;
}
}
}

@supports selector(::-webkit-scrollbar) {
*::-webkit-scrollbar {
@apply w-3.5;
Expand Down
2 changes: 2 additions & 0 deletions apps/ui-kit/src/lib/tailwind/base.presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import {
OPACITY,
generateVariableSpacing,
} from './constants';
import { firefoxPlugin } from './plugins';

export const BASE_CONFIG: Config = {
content: ['./src/**/*.{html,js,jsx,ts,tsx}'],
darkMode: 'class',
plugins: [firefoxPlugin],
theme: {
extend: {
fontSize: {
Expand Down
8 changes: 8 additions & 0 deletions apps/ui-kit/src/lib/tailwind/plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2024 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

import plugin from 'tailwindcss/plugin';

export const firefoxPlugin = plugin(({ addVariant }) => {
addVariant('firefox', '@-moz-document url-prefix()');
});

0 comments on commit c0ef9f2

Please sign in to comment.