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

container queries #211

Merged
merged 6 commits into from
Nov 1, 2024
Merged
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
112 changes: 112 additions & 0 deletions dist/docsite/json/platform-tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -11044,6 +11044,118 @@
}
}
],
"container-query": [
{
"$value": "Container content rendered at extra small breakpoint only with optional name",
"category": "container-query",
"name": "cdr-xs-cq-only",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered at extra small breakpoint and above with optional name",
"category": "container-query",
"name": "cdr-xs-cq-up",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered at small breakpoint only with optional name",
"category": "container-query",
"name": "cdr-sm-cq-only",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered at small breakpoint and above with optional name",
"category": "container-query",
"name": "cdr-sm-cq-up",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered below small breakpoint with optional name",
"category": "container-query",
"name": "cdr-sm-cq-down",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered at medium breakpoint only with optional name",
"category": "container-query",
"name": "cdr-md-cq-only",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered at medium breakpoint and above with optional name",
"category": "container-query",
"name": "cdr-md-cq-up",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered below medium breakpoint with optional name",
"category": "container-query",
"name": "cdr-md-cq-down",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered at large breakpoint only with optional name",
"category": "container-query",
"name": "cdr-lg-cq-only",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered at large breakpoint and above with optional name",
"category": "container-query",
"name": "cdr-lg-cq-up",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
},
{
"$value": "Container content rendered below large breakpoint with optional name",
"category": "container-query",
"name": "cdr-lg-cq-down",
"attributes": {
"option": false,
"deprecated": false,
"category": "container-query"
}
}
],
"colors": [],
"misc": [
{
Expand Down
161 changes: 161 additions & 0 deletions dist/docsite/less/cdr-tokens.less
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,142 @@
@cdr-knockout-color-icon-inverse-default: #d5cfc3;
@cdr-knockout-color-icon-background-note: #c4b03b;

// XS
.cdr-xs-cq-up(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-xs) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-xs) {
@rules();
}
}
}

.cdr-xs-cq-only(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-xs) and (max-width: calc(@cdr-breakpoint-sm - 1px)) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-xs) and (max-width: calc(@cdr-breakpoint-sm - 1px)) {
@rules();
}
}
}

// SM
.cdr-sm-cq-down(@name: '', @rules) {
@container @name (max-width: calc(@cdr-breakpoint-sm - 1px)) {
@rules();
}

@supports not (contain: inline-size) {
@media (max-width: calc(@cdr-breakpoint-sm - 1px)) {
@rules();
}
}
}

.cdr-sm-cq-up(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-sm) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-sm) {
@rules();
}
}
}

.cdr-sm-cq-only(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-sm) and (max-width: calc(@cdr-breakpoint-md - 1px)) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-sm) and (max-width: calc(@cdr-breakpoint-md - 1px)) {
@rules();
}
}
}

// MD
.cdr-md-cq-down(@name: '', @rules) {
@container @name (max-width: calc(@cdr-breakpoint-md - 1px)) {
@rules();
}

@supports not (contain: inline-size) {
@media (max-width: calc(@cdr-breakpoint-md - 1px)) {
@rules();
}
}
}

.cdr-md-cq-up(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-md) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-md) {
@rules();
}
}
}

.cdr-md-cq-only(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-md) and (max-width: calc(@cdr-breakpoint-lg - 1px)) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-md) and (max-width: calc(@cdr-breakpoint-lg - 1px)) {
@rules();
}
}
}

// LG
.cdr-lg-cq-down(@name: '', @rules) {
@container @name (max-width: calc(@cdr-breakpoint-lg - 1px)) {
@rules();
}

@supports not (contain: inline-size) {
@media (max-width: calc(@cdr-breakpoint-lg - 1px)) {
@rules();
}
}
}

.cdr-lg-cq-up(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-lg) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-lg) {
@rules();
}
}
}

.cdr-lg-cq-only(@name: '', @rules) {
@container @name (min-width: @cdr-breakpoint-lg) {
@rules();
}

@supports not (contain: inline-size) {
@media (min-width: @cdr-breakpoint-lg) {
@rules();
}
}
}

.cdr-display-sr-only() {
position: absolute;
width: 1px;
Expand Down Expand Up @@ -1749,3 +1885,28 @@
@rules();
}
}

// DEPRECATED summer 2024
.cdr-xs-mq(@rules) {
@media (min-width: @cdr-breakpoint-xs) {
@rules();
}
}

.cdr-sm-mq(@rules) {
@media (min-width: @cdr-breakpoint-sm) {
@rules();
}
}

.cdr-md-mq(@rules) {
@media (min-width: @cdr-breakpoint-md) {
@rules();
}
}

.cdr-lg-mq(@rules) {
@media (min-width: @cdr-breakpoint-lg) {
@rules();
}
}
Loading