Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💄 Fix styles for mobile #2701 #2720

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { anchor } from '@equinor/eds-icons'
import { EdsIcon } from '../../../icons'
import { AnchorLinkDescription } from '../anchorReferenceField'
import { Rule } from 'sanity'

export type AnchorLinkReference = {
_type: 'anchorLinkReference'
Expand All @@ -16,6 +17,7 @@ export default {
name: 'title',
description: 'Visible title for the anchor link in the list of anchors',
type: 'string',
validation: (Rule: Rule) => Rule.required(),
},
{
name: 'anchorReference',
Expand Down
6 changes: 3 additions & 3 deletions web/sections/AnchorLinkList/AnchorLinkList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AnchorLinkList = forwardRef<HTMLElement, AnchorLinkListProps>(function Anc
const { title, anchorList = [], columns } = data

const getFlow = () => {
const commonGridStyling = 'grid auto-fill-fr lg:place-items-start'
const commonGridStyling = 'grid lg:place-items-start grid-cols-3'
switch (columns) {
case '3':
return `${commonGridStyling} lg:grid-cols-3`
Expand All @@ -29,7 +29,7 @@ const AnchorLinkList = forwardRef<HTMLElement, AnchorLinkListProps>(function Anc
return `${commonGridStyling} lg:grid-cols-6`
default:
case 'flex':
return 'grid auto-fill-fr justify-start'
return 'grid grid-cols-auto-fill-fr justify-start'
}
}
return (
Expand All @@ -49,7 +49,7 @@ const AnchorLinkList = forwardRef<HTMLElement, AnchorLinkListProps>(function Anc
{anchorList?.map((anchorLink: { id: string; title?: string; anchorReference?: string }) => {
const anchor = anchorLink?.anchorReference ? `#${anchorLink?.anchorReference}` : ''
return (
<li key={`anchor_link_${anchorLink?.id}`} className="w-full flex justify-center">
<li key={`anchor_link_${anchorLink?.id}`} className="w-full flex justify-start">
<ButtonLink variant="ghost" href={anchor} className="w-max text-moss-green-100">
{anchorLink?.title}
</ButtonLink>
Expand Down
2 changes: 1 addition & 1 deletion web/tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ module.exports = {
}),
transitionProperty: ['motion-safe'],
gridTemplateColumns: {
'auto-fill-fr': `repeat(auto-fill, minmax(80px,1fr))`,
'auto-fill-fr': `repeat(auto-fill,minmax(150px,1fr))`,
card: `repeat(auto-fill, minmax(min(100%, theme(spacing.card-minWidth)), theme(spacing.card-maxWidth)))`,
},
},
Expand Down
Loading