ApplyTo¶
Description: The applyTo
option property applies its value to the <identifier>
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
option: {
key: '[class$="test"]'
applyTo: '.applyToTest'
}
font-size: 2em
}
})
.test > div:
width: 200px
attribute:
option:
key: '[class$="test"]'
applyTo: .applyToTest
font-size: 2em
.test > div {
width: 200px;
}
.test > div[class$="test"] .applyToTest {
font-size: 2em;
}
ctr('.test > div', {
width: 200px
attribute: {
option: {
key: '[class$="test"]'
applyTo: '.applyToTest'
}
font-size: 2em
}
})
.test > div {
width: 200px;
}
.test > div[class$="test"] .applyToTest {
font-size: 2em;
}
.test > div:
width: 200px
attribute:
option:
key: '[class$="test"]'
applyTo: .applyToTest
font-size: 2em
Notes
- The
applyTo
property differs from theappendTo
property in that there is space between the<identifier>
and theapplyTo
valueapplyTo
<identifier> <applyTo>
appendTo
<identifier><appendTo>
AppendTo¶
Description: The appendTo
option property appends its value to the <identifier>
.
Edit
ctr('.test > div', {
width: 200px
attribute: {
option: {
key: '[class$="test"]'
appendTo: ':first-child'
}
font-size: 1em
}
})
.test > div:
width: 200px
attribute:
option:
key: '[class$="test"]'
appendTo: :first-child
font-size: 1em
.test > div {
width: 200px;
}
.test > div[class$="test"]:first-child {
font-size: 1em;
}
ctr('.test > div', {
width: 200px
attribute: {
option: {
key: '[class$="test"]'
appendTo: ':first-child'
}
font-size: 1em
}
})
.test > div {
width: 200px;
}
.test > div[class$="test"]:first-child {
font-size: 1em;
}
.test > div:
width: 200px
attribute:
option:
key: '[class$="test"]'
appendTo: :first-child
font-size: 1em
Notes
- The
appendTo
property differs from theapplyTo
property in that there is no space between the<identifier>
and theappendTo
valueappendTo
<identifier><appendTo>
applyTo
<identifier> <applyTo>
Override¶
Description: The override
option property overrides the entirety of the selector, including the <identifier>
, with its value.
Edit
ctr('.test > div', {
width: 200px
attribute: {
option: {
key: '[class$="test"]'
override: '#override'
}
font-size: 3em
}
})
.test > div:
width: 200px
attribute:
option:
key: '[class$="test"]'
override: '#override'
font-size: 3em
.test > div {
width: 200px;
}
#override {
font-size: 3em;
}
ctr('.test > div', {
width: 200px
attribute: {
option: {
key: '[class$="test"]'
override: '#override'
}
font-size: 3em
}
})
.test > div {
width: 200px;
}
#override {
font-size: 3em;
}
.test > div:
width: 200px
attribute:
option:
key: '[class$="test"]'
override: '#override'
font-size: 3em
Notes
- Due to the nature of Stylus, this feature only works with a declarative
ctr
instance