tomhodgins/element-queries-spec
소개
컨테이너 스타일 요소 쿼리 구문 사양
시스템 및 인프라측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalCSS Element Queries
A spec for a container-style element query syntax in CSS
Read online: element-queries.html
What is this about?
This spec aims to define a syntax for scoped styles and element queries in a container query style, as well as the related selectors, functions, and units that make scoped styles and element queries versatile and powerful way to write layout-independent responsive conditions for elements in CSS.
Proposed Syntax
/* Scoped Style */
@element div {
:self {
background: lime;
}
}
/* Element Query */
@element div and (min-width: 500px) {
:self {
background: lime;
}
}
/* Container Query */
@element div and (min-width: 500px) {
:self {
background: lime;
}
html {
background: red;
}
}
/* Multiple Selectors */
@element #example-1, #example-2 {
:self {
background: lime;
}
}
/* Multiple Conditions */
@element div and (min-width: 500px) and (min-characters: 5) {
:self {
background: lime;
}
}
View Syntax Example: styles.css
Plugin & Demo
As a reference for the syntax described in the spec, I have included a JavaScript plugin that reads the proposed syntax and displays the desired behaviour of the proposed functionality.
View Plugin: element-queries.js
View Demo: demo.html
Related Projects
There are a few projects currently working with the syntax described in this spec:
- EQCSS Element Query CSS browser plugin
- eqcss-compiler an EQCSS to JavaScript compiler
Further Examples
More examples of this syntax can be found on Codepen by searching for "EQCSS".
Search Codepen for EQCSS: Codepen Search
Who am I?
I'm an independent web developer, not affiliated with any major companies. The research & development contained in this spec is my own.
How you can help
At this stage the work on this spec is focused on taking the existing EQCSS syntax for element queries as implemented by the EQCSS project and defining them in a more formal way so that other plugin builders could design plugins or tools that work with the EQCSS syntax as implemented by EQCSS.js
In the future once the first version of this document is complete, there will be an opportunity to extend the features described.
For now, the most productive way to provide input would be by contributing to the conversation in the Gitter chat room for the EQCSS project
Further Reading
관련 프로젝트 살펴보기
불러오는 중…