Skip to content

Commit

Permalink
🐛 fix: Fix Gallery "position: sticky" for mobile UI (#483)
Browse files Browse the repository at this point in the history
Fix (#483)
Add src/styles/mobile.ts for media queries
  • Loading branch information
kaalibro committed Dec 10, 2023
1 parent 4c16147 commit 44a04bd
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 2 deletions.
47 changes: 45 additions & 2 deletions javascript/main.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import progress from './components/progress';
import slider from './components/slider';
import table from './components/table';
import tabs from './components/tabs';
import mobile from './mobile';
import tokens from './tokens';

const GlobalStyle = createGlobalStyle(({ theme }) => [
Expand All @@ -34,6 +35,7 @@ const GlobalStyle = createGlobalStyle(({ theme }) => [
popup(theme),
extensions(theme),
lightboxModal(theme),
mobile(),
]);

export default GlobalStyle;
46 changes: 46 additions & 0 deletions src/styles/mobile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { css } from 'antd-style';

export default () => css`
@media (max-width: 575px) {
#quicksettings {
> div,
> fieldset {
flex: 1 !important;
max-width: unset !important;
}
}
.tabs {
.tabitem,
.gradio-tabitem {
padding: 8px !important;
}
#img2img_results,
#txt2img_results,
#extras_results {
position: relative;
top: 0 !important;
width: 100%;
&.mobile {
margin-top: 8px;
}
}
[id$='_settings'] {
width: 100%;
}
}
#tab_settings {
#settings .tab-nav {
width: 35%;
}
.tabitem {
margin-left: 35%;
}
}
}
`;

0 comments on commit 44a04bd

Please sign in to comment.