Метатег Viewport в маршрутизаторе приложений NextJS 14 с проблемой «shrink-to-fit=yes»CSS

Разбираемся в CSS
Ответить Пред. темаСлед. тема
Гость
 Метатег Viewport в маршрутизаторе приложений NextJS 14 с проблемой «shrink-to-fit=yes»

Сообщение Гость »


I'm trying to make my NextJS 14 app router application scale down on any device less than 500px width, as I'm making my app responsive down to 500px wide and anything below that I want it to scale down, previously I've used

Код: Выделить всё

min-width: 500px;
in the CSS and used this tag inside the tag:

And that would work on Chrome and Safari mobile apps and everywhere else, however now with NextJS 14, I can't set this tag directly in the tag inside the

Код: Выделить всё

layout.tsx
file as there's an already defined viewport tag and this new one will be a duplicate and won't take effect, the new way of setting and changing this default viewport tag is changed to this way instead:

Код: Выделить всё

import type { Viewport } from 'next'   export const viewport: Viewport = {   width: 500,   maximumScale: 1,   userScalable: false, } 
Reference: https://nextjs.org/docs/app/api-referen ... e-viewport

But this doesn't support

Код: Выделить всё

shrink-to-fit=yes
and without adding it, the app would be zoomed in on Safari browser and some other browsers with some horizontal scroll.

Is there a way to set the metatag with

Код: Выделить всё

shrink-to-fit=yes
or another way to fix this issue of being zoomed in on Safari Mobile view when loading the page?


Источник: https://stackoverflow.com/questions/781 ... -yes-issue
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Метатег Viewport в маршрутизаторе приложений NextJS 14 с проблемой «shrink-to-fit=yes»
    Гость » » в форуме CSS
    0 Ответы
    26 Просмотры
    Последнее сообщение Гость
  • Метатег Viewport в маршрутизаторе приложений NextJS 14 с проблемой «shrink-to-fit=yes»
    Anonymous » » в форуме CSS
    0 Ответы
    22 Просмотры
    Последнее сообщение Anonymous
  • (iOS) Метатег viewport-fit=cover несовершенно работает с панелями навигации.
    Anonymous » » в форуме IOS
    0 Ответы
    52 Просмотры
    Последнее сообщение Anonymous
  • ViewPort-Fit = Cover не расширяет ViewPort в зону статуса (вокруг Notch) на сафари для iOS
    Anonymous » » в форуме IOS
    0 Ответы
    21 Просмотры
    Последнее сообщение Anonymous
  • NextJs Webpack — импортируйте другой проект NextJs B в качестве модуля/фреймворка внутри проекта NextJs A.
    Anonymous » » в форуме CSS
    0 Ответы
    65 Просмотры
    Последнее сообщение Anonymous

Вернуться в «CSS»