Animation¶
Description: animation
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
color: red
// animation
animation: {
name: 'test'
timeline: {
'50': {
font-size: 10px
}
}
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
color: red
# animation
animation:
name: test
timeline:
50:
font-size: 10px
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
color: #f00;
animation-delay: 0s;
animation-name: test;
animation-duration: 0.5s;
animation-fill-mode: none;
animation-direction: normal;
animation-iteration-count: 1;
animation-play-state: running;
animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
@keyframes test {
50% {
font-size: 10px;
}
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
color: red
// animation
animation: {
name: 'test'
timeline: {
'50': {
font-size: 10px
}
}
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
color: #f00;
animation-delay: 0s;
animation-name: test;
animation-duration: 0.5s;
animation-fill-mode: none;
animation-direction: normal;
animation-iteration-count: 1;
animation-play-state: running;
animation-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
@keyframes test {
50% {
font-size: 10px;
}
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
color: red
# animation
animation:
name: test
timeline:
50:
font-size: 10px
Component¶
Description: component
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// component
component-span: {
font-size: 10px
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# component
component-span:
font-size: 10px
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
.test > div[data-role="test"] > span {
font-size: 10px;
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// component
component-span: {
font-size: 10px
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
.test > div[data-role="test"] > span {
font-size: 10px;
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# component
component-span:
font-size: 10px
Element¶
Description: element
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// element
first-child: {
font-size: 10px
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# element
first-child:
font-size: 10px
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
.test > div[data-role="test"]:first-child {
font-size: 10px;
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// element
first-child: {
font-size: 10px
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
.test > div[data-role="test"]:first-child {
font-size: 10px;
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# element
first-child:
font-size: 10px
Grid¶
Description: grid
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
height: 300px
// grid
grid: {
column: '1/2'
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
height: 300px
# grid
grid:
column: 1/2
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
height: 300px;
flex: 0 0 auto;
width: calc(99.9% * 1 / 2 - (30px - 30px * 1 / 2));
}
.test > div[data-role="test"]:nth-child(1n) {
margin-right: 30px;
}
.test > div[data-role="test"]:last-child {
margin-right: 0;
}
.test > div[data-role="test"]:nth-child(2n) {
float: right;
margin-right: 0;
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
height: 300px
// grid
grid: {
column: '1/2'
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
height: 300px;
flex: 0 0 auto;
width: calc(99.9% * 1 / 2 - (30px - 30px * 1 / 2));
}
.test > div[data-role="test"]:nth-child(1n) {
margin-right: 30px;
}
.test > div[data-role="test"]:last-child {
margin-right: 0;
}
.test > div[data-role="test"]:nth-child(2n) {
float: right;
margin-right: 0;
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
height: 300px
# grid
grid:
column: 1/2
Media¶
Description: media
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// media
media-sm: {
width: 200px
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# media
media-sm:
width: 200px
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
@media (min-width: 400px) and (max-width: 600px) {
.test > div[data-role="test"] {
width: 200px;
}
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// media
media-sm: {
width: 200px
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
@media (min-width: 400px) and (max-width: 600px) {
.test > div[data-role="test"] {
width: 200px;
}
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# media
media-sm:
width: 200px
Non¶
Description: non
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// non
non-span: {
font-size: 10px
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# non
non-span:
font-size: 10px
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
.test > div[data-role="test"]:not(span) {
font-size: 10px;
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// non
non-span: {
font-size: 10px
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
}
.test > div[data-role="test"]:not(span) {
font-size: 10px;
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# non
non-span:
font-size: 10px
State¶
Description: state
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
color: red
// state
hover-on: {
font-size: 10px
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
color: red
# state
hover-on:
font-size: 10px
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
color: #f00;
}
.test > div[data-role="test"]:hover {
font-size: 10px;
transition-delay: 0s;
transition-duration: 0.5s;
transition-property: font-size;
transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
color: red
// state
hover-on: {
font-size: 10px
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
color: #f00;
}
.test > div[data-role="test"]:hover {
font-size: 10px;
transition-delay: 0s;
transition-duration: 0.5s;
transition-property: font-size;
transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
color: red
# state
hover-on:
font-size: 10px
Transition¶
Description: transition
can be used in an attribute
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// transition
transition: {
background: black
}
}
})
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# transition
transition:
background: black
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
background: #000;
transition-delay: 0s;
transition-duration: 0.5s;
transition-property: background;
transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
ctr('.test > div', {
width: 200px
attribute: {
key: '[data-role="test"]'
width: 300px
// transition
transition: {
background: black
}
}
})
.test > div {
width: 200px;
}
.test > div[data-role="test"] {
width: 300px;
background: #000;
transition-delay: 0s;
transition-duration: 0.5s;
transition-property: background;
transition-timing-function: cubic-bezier(0.42, 0, 0.58, 1);
}
.test > div:
width: 200px
attribute:
key: '[data-role="test"]'
width: 300px
# transition
transition:
background: black