Skip to content

CSS: responsive

[class*="-hidden-"],[class*="-show-"] — 在主题断点尺度上,按视口或容器宽度显示/隐藏的类。

.instui-hidden-max-<bp>/-hidden-min-<bp> 根据视口宽度隐藏;.instui-show-max-<bp>/-show-min-<bp> 则相反(默认隐藏,仅在范围内通过 display: revert 显示);-cq- 变体改为响应 .instui-container 祖先的宽度,而不是视口。比例级别 xs/sm/md/lg/xl(来自 IR 的 tray-width 组件令牌)分别有长格式拼写别名(x-smallx-large)和设备名称(mobile/phablet/tablet/laptop/desktop)— 两者均已弃用,建议使用短名称 — 以及未缩放的主题化 content/content-full-width 级别(主内容区域的最大宽度)。

Source: index.ts

用法

css
@import "@pantoken/components/utilities.css";

示例

html
<div class="instui-hidden-max-sm">Hidden at or below the small breakpoint.</div>
<div class="instui-show-min-sm">Shown only at or above the small breakpoint.</div>

修饰符

修饰符描述
.-cq-hidden-max-content当标记的容器处于或小于 content 断点(68.75em)时隐藏。
.-cq-hidden-max-content-full-width当标记的容器处于或小于 content-full-width 断点(98.75em)时隐藏。
.-cq-hidden-max-desktopAlias — maps to .-cq-hidden-max-xl.
.-cq-hidden-max-laptopAlias — maps to .-cq-hidden-max-lg.
.-cq-hidden-max-largeAlias — maps to .-cq-hidden-max-lg.
.-cq-hidden-max-lg当标记的容器处于或小于 lg 断点(48em)时隐藏。
.-cq-hidden-max-md当标记的容器处于或小于 md 断点(30em)时隐藏。
.-cq-hidden-max-mediumAlias — maps to .-cq-hidden-max-md.
.-cq-hidden-max-mobileAlias — maps to .-cq-hidden-max-xs.
.-cq-hidden-max-phabletAlias — maps to .-cq-hidden-max-sm.
.-cq-hidden-max-sm当标记的容器处于或小于 sm 断点(20em)时隐藏。
.-cq-hidden-max-smallAlias — maps to .-cq-hidden-max-sm.
.-cq-hidden-max-tabletAlias — maps to .-cq-hidden-max-md.
.-cq-hidden-max-x-largeAlias — maps to .-cq-hidden-max-xl.
.-cq-hidden-max-x-smallAlias — maps to .-cq-hidden-max-xs.
.-cq-hidden-max-xl当标记的容器处于或小于 xl 断点(62em)时隐藏。
.-cq-hidden-max-xs当标记的容器处于或小于 xs 断点(16em)时隐藏。
.-cq-hidden-min-content当标记的容器处于或大于 content 断点(68.75em)时隐藏。
.-cq-hidden-min-content-full-width当标记的容器处于或大于 content-full-width 断点(98.75em)时隐藏。
.-cq-hidden-min-desktopAlias — maps to .-cq-hidden-min-xl.
.-cq-hidden-min-laptopAlias — maps to .-cq-hidden-min-lg.
.-cq-hidden-min-largeAlias — maps to .-cq-hidden-min-lg.
.-cq-hidden-min-lg当标记的容器处于或大于 lg 断点(48em)时隐藏。
.-cq-hidden-min-md当标记的容器处于或大于 md 断点(30em)时隐藏。
.-cq-hidden-min-mediumAlias — maps to .-cq-hidden-min-md.
.-cq-hidden-min-mobileAlias — maps to .-cq-hidden-min-xs.
.-cq-hidden-min-phabletAlias — maps to .-cq-hidden-min-sm.
.-cq-hidden-min-sm当标记的容器处于或大于 sm 断点(20em)时隐藏。
.-cq-hidden-min-smallAlias — maps to .-cq-hidden-min-sm.
.-cq-hidden-min-tabletAlias — maps to .-cq-hidden-min-md.
.-cq-hidden-min-x-largeAlias — maps to .-cq-hidden-min-xl.
.-cq-hidden-min-x-smallAlias — maps to .-cq-hidden-min-xs.
.-cq-hidden-min-xl当标记的容器处于或大于 xl 断点(62em)时隐藏。
.-cq-hidden-min-xs当标记的容器处于或大于 xs 断点(16em)时隐藏。
.-cq-show-max-content当标记的容器处于或小于 content 断点(68.75em)时显示;否则隐藏。
.-cq-show-max-content-full-width当标记的容器处于或小于 content-full-width 断点(98.75em)时显示;否则隐藏。
.-cq-show-max-desktopAlias — maps to .-cq-show-max-xl.
.-cq-show-max-laptopAlias — maps to .-cq-show-max-lg.
.-cq-show-max-largeAlias — maps to .-cq-show-max-lg.
.-cq-show-max-lg当标记的容器处于或小于 lg 断点(48em)时显示;否则隐藏。
.-cq-show-max-md当标记的容器处于或小于 md 断点(30em)时显示;否则隐藏。
.-cq-show-max-mediumAlias — maps to .-cq-show-max-md.
.-cq-show-max-mobileAlias — maps to .-cq-show-max-xs.
.-cq-show-max-phabletAlias — maps to .-cq-show-max-sm.
.-cq-show-max-sm当标记的容器处于或小于 sm 断点(20em)时显示;否则隐藏。
.-cq-show-max-smallAlias — maps to .-cq-show-max-sm.
.-cq-show-max-tabletAlias — maps to .-cq-show-max-md.
.-cq-show-max-x-largeAlias — maps to .-cq-show-max-xl.
.-cq-show-max-x-smallAlias — maps to .-cq-show-max-xs.
.-cq-show-max-xl当标记的容器处于或小于 xl 断点(62em)时显示;否则隐藏。
.-cq-show-max-xs当标记的容器处于或小于 xs 断点(16em)时显示;否则隐藏。
.-cq-show-min-content当标记的容器处于或大于 content 断点(68.75em)时显示;否则隐藏。
.-cq-show-min-content-full-width当标记的容器处于或大于 content-full-width 断点(98.75em)时显示;否则隐藏。
.-cq-show-min-desktopAlias — maps to .-cq-show-min-xl.
.-cq-show-min-laptopAlias — maps to .-cq-show-min-lg.
.-cq-show-min-largeAlias — maps to .-cq-show-min-lg.
.-cq-show-min-lg当标记的容器处于或大于 lg 断点(48em)时显示;否则隐藏。
.-cq-show-min-md当标记的容器处于或大于 md 断点(30em)时显示;否则隐藏。
.-cq-show-min-mediumAlias — maps to .-cq-show-min-md.
.-cq-show-min-mobileAlias — maps to .-cq-show-min-xs.
.-cq-show-min-phabletAlias — maps to .-cq-show-min-sm.
.-cq-show-min-sm当标记的容器处于或大于 sm 断点(20em)时显示;否则隐藏。
.-cq-show-min-smallAlias — maps to .-cq-show-min-sm.
.-cq-show-min-tabletAlias — maps to .-cq-show-min-md.
.-cq-show-min-x-largeAlias — maps to .-cq-show-min-xl.
.-cq-show-min-x-smallAlias — maps to .-cq-show-min-xs.
.-cq-show-min-xl当标记的容器处于或大于 xl 断点(62em)时显示;否则隐藏。
.-cq-show-min-xs当标记的容器处于或大于 xs 断点(16em)时显示;否则隐藏。
.-hidden-max-content当视口处于或小于 content 断点(68.75em)时隐藏。
.-hidden-max-content-full-width当视口处于或小于 content-full-width 断点(98.75em)时隐藏。
.-hidden-max-desktopAlias — maps to .-hidden-max-xl.
.-hidden-max-laptopAlias — maps to .-hidden-max-lg.
.-hidden-max-largeAlias — maps to .-hidden-max-lg.
.-hidden-max-lg当视口处于或小于 lg 断点(48em)时隐藏。
.-hidden-max-md当视口处于或小于 md 断点(30em)时隐藏。
.-hidden-max-mediumAlias — maps to .-hidden-max-md.
.-hidden-max-mobileAlias — maps to .-hidden-max-xs.
.-hidden-max-phabletAlias — maps to .-hidden-max-sm.
.-hidden-max-sm当视口处于或小于 sm 断点(20em)时隐藏。
.-hidden-max-smallAlias — maps to .-hidden-max-sm.
.-hidden-max-tabletAlias — maps to .-hidden-max-md.
.-hidden-max-x-largeAlias — maps to .-hidden-max-xl.
.-hidden-max-x-smallAlias — maps to .-hidden-max-xs.
.-hidden-max-xl当视口处于或小于 xl 断点(62em)时隐藏。
.-hidden-max-xs当视口处于或小于 xs 断点(16em)时隐藏。
.-hidden-min-content当视口处于或大于 content 断点(68.75em)时隐藏。
.-hidden-min-content-full-width当视口处于或大于 content-full-width 断点(98.75em)时隐藏。
.-hidden-min-desktopAlias — maps to .-hidden-min-xl.
.-hidden-min-laptopAlias — maps to .-hidden-min-lg.
.-hidden-min-largeAlias — maps to .-hidden-min-lg.
.-hidden-min-lg当视口处于或大于 lg 断点(48em)时隐藏。
.-hidden-min-md当视口处于或高于 md 断点(30em)时隐藏。
.-hidden-min-mediumAlias — maps to .-hidden-min-md.
.-hidden-min-mobileAlias — maps to .-hidden-min-xs.
.-hidden-min-phabletAlias — maps to .-hidden-min-sm.
.-hidden-min-sm当视口处于或高于 sm 断点(20em)时隐藏。
.-hidden-min-smallAlias — maps to .-hidden-min-sm.
.-hidden-min-tabletAlias — maps to .-hidden-min-md.
.-hidden-min-x-largeAlias — maps to .-hidden-min-xl.
.-hidden-min-x-smallAlias — maps to .-hidden-min-xs.
.-hidden-min-xl当视口处于或高于 xl 断点(62em)时隐藏。
.-hidden-min-xs当视口处于或高于 xs 断点(16em)时隐藏。
.-show-max-content当视口处于或低于 content 断点(68.75em)时显示(与 -hidden-min-content 相反);否则隐藏。
.-show-max-content-full-width当视口处于或低于 content-full-width 断点(98.75em)时显示(与 -hidden-min-content-full-width 相反);否则隐藏。
.-show-max-desktopAlias — maps to .-show-max-xl.
.-show-max-laptopAlias — maps to .-show-max-lg.
.-show-max-largeAlias — maps to .-show-max-lg.
.-show-max-lg当视口处于或低于 lg 断点(48em)时显示(与 -hidden-min-lg 相反);否则隐藏。
.-show-max-md当视口处于或低于 md 断点(30em)时显示(与 -hidden-min-md 相反);否则隐藏。
.-show-max-mediumAlias — maps to .-show-max-md.
.-show-max-mobileAlias — maps to .-show-max-xs.
.-show-max-phabletAlias — maps to .-show-max-sm.
.-show-max-sm当视口处于或低于 sm 断点(20em)时显示(与 -hidden-min-sm 相反);否则隐藏。
.-show-max-smallAlias — maps to .-show-max-sm.
.-show-max-tabletAlias — maps to .-show-max-md.
.-show-max-x-largeAlias — maps to .-show-max-xl.
.-show-max-x-smallAlias — maps to .-show-max-xs.
.-show-max-xl当视口处于或低于 xl 断点(62em)时显示(与 -hidden-min-xl 相反);否则隐藏。
.-show-max-xs当视口处于或低于 xs 断点(16em)时显示(与 -hidden-min-xs 相反);否则隐藏。
.-show-min-content当视口处于或高于 content 断点(68.75em)时显示(与 -hidden-max-content 相反);否则隐藏。
.-show-min-content-full-width当视口处于或高于 content-full-width 断点(98.75em)时显示(与 -hidden-max-content-full-width 相反);否则隐藏。
.-show-min-desktopAlias — maps to .-show-min-xl.
.-show-min-laptopAlias — maps to .-show-min-lg.
.-show-min-largeAlias — maps to .-show-min-lg.
.-show-min-lg当视口处于或高于 lg 断点(48em)时显示(与 -hidden-max-lg 相反);否则隐藏。
.-show-min-md当视口处于或高于 md 断点(30em)时显示(与 -hidden-max-md 相反);否则隐藏。
.-show-min-mediumAlias — maps to .-show-min-md.
.-show-min-mobileAlias — maps to .-show-min-xs.
.-show-min-phabletAlias — maps to .-show-min-sm.
.-show-min-sm当视口处于或高于 sm 断点(20em)时显示(与 -hidden-max-sm 相反);否则隐藏。
.-show-min-smallAlias — maps to .-show-min-sm.
.-show-min-tabletAlias — maps to .-show-min-md.
.-show-min-x-largeAlias — maps to .-show-min-xl.
.-show-min-x-smallAlias — maps to .-show-min-xs.
.-show-min-xl当视口处于或高于 xl 断点(62em)时显示(与 -hidden-max-xl 相反);否则隐藏。
.-show-min-xs当视口处于或高于 xs 断点(16em)时显示(与 -hidden-max-xs 相反);否则隐藏。

自定义属性

属性类型默认描述
--pantoken-bp-content<length>68.75emcontent 断点的值(68.75em,手工编写,有主题化(不在令牌 IR 中))。覆盖它不会将已编译的 @media/@container 阈值向上移动。
--pantoken-bp-content-full-width<length>98.75emcontent-full-width 断点的值(98.75em,手工编写,有主题化(不在令牌 IR 中))。覆盖它不会将已编译的 @media/@container 阈值向上移动。
--pantoken-bp-lg<length>48emlg 断点的值(48em,镜像 --instui-component-tray-width-lg)。覆盖它不会将已编译的 @media/@container 阈值向上移动。
--pantoken-bp-md<length>30emmd 断点的值(30em,镜像 --instui-component-tray-width-md)。覆盖它不会将已编译的 @media/@container 阈值向上移动。
--pantoken-bp-sm<length>20emsm 断点的值(20em,镜像 --instui-component-tray-width-sm)。覆盖它不会将已编译的 @media/@container 阈值向上移动。
--pantoken-bp-xl<length>62emxl 断点的值(62em,镜像 --instui-component-tray-width-xl)。覆盖它不会将已编译的 @media/@container 阈值向上移动。
--pantoken-bp-xs<length>16emxs 断点的值(16em,镜像 --instui-component-tray-width-xs)。覆盖它不会将已编译的 @media/@container 阈值向上移动。

条件

类型查询描述
media(max-width: 16em)xs 断点的上界。
media(min-width: 16em)xs 断点的下界。
media(max-width: 20em)sm 断点的上界。
media(min-width: 20em)sm 断点的下界。
media(max-width: 30em)md 断点的上界。
media(min-width: 30em)md 断点的下界。
media(max-width: 48em)lg 断点的上界。
media(min-width: 48em)lg 断点的下界。
media(max-width: 62em)xl 断点的上界。
media(min-width: 62em)xl 断点的下界。
media(max-width: 68.75em)content 断点的上界。
media(min-width: 68.75em)content 断点的下界。
media(max-width: 98.75em)content-full-width 断点的上界。
media(min-width: 98.75em)content-full-width 断点的下界。
container(max-width: 16em)针对标记容器评估的 xs 断点上界。
container(min-width: 16em)针对标记容器评估的 xs 断点下界。
container(max-width: 20em)针对标记容器评估的 sm 断点上界。
container(min-width: 20em)针对标记容器评估的 sm 断点下界。
container(max-width: 30em)针对已标记容器评估的 md 断点的上限。
container(min-width: 30em)针对已标记容器评估的 md 断点的下限。
container(max-width: 48em)针对已标记容器评估的 lg 断点的上限。
container(min-width: 48em)针对已标记容器评估的 lg 断点的下限。
container(max-width: 62em)针对已标记容器评估的 xl 断点的上限。
container(min-width: 62em)针对已标记容器评估的 xl 断点的下限。
container(max-width: 68.75em)针对已标记容器评估的 content 断点的上限。
container(min-width: 68.75em)针对已标记容器评估的 content 断点的下限。
container(max-width: 98.75em)针对已标记容器评估的 content-full-width 断点的上限。
container(min-width: 98.75em)针对已标记容器评估的 content-full-width 断点的下限。

消耗代币

Token类型
--instui-component-tray-width-lg<length>48em
--instui-component-tray-width-md<length>30em
--instui-component-tray-width-sm<length>20em
--instui-component-tray-width-xl<length>62em
--instui-component-tray-width-xs<length>16em