mirror of https://github.com/sveltejs/svelte
parent
d11556c248
commit
1f8bf93ffa
@ -0,0 +1,9 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'css_global_block_invalid_modifier',
|
||||
message: 'A :global {...} block cannot modify an existing selector',
|
||||
position: [100, 107]
|
||||
}
|
||||
});
|
||||
@ -0,0 +1,14 @@
|
||||
<style>
|
||||
/* ok */
|
||||
div :global.x {
|
||||
color: red;
|
||||
}
|
||||
:global.x {
|
||||
color: red;
|
||||
}
|
||||
|
||||
/* not ok */
|
||||
.x:global {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
@ -1,11 +0,0 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
error: {
|
||||
code: 'css_global_block_invalid_placement',
|
||||
message:
|
||||
':global cannot be at the end of a selector with children starting with a `&` (aka nesting) selector. ' +
|
||||
'Either remove those nested child selectors, or append the :global selector to the end of the previous selector (e.g. `div:global` instead of `div :global`)',
|
||||
position: [184, 192]
|
||||
}
|
||||
});
|
||||
@ -1,27 +0,0 @@
|
||||
<style>
|
||||
/* ok */
|
||||
div :global {
|
||||
p {
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
div {
|
||||
:global {
|
||||
p {
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
}
|
||||
div:global {
|
||||
&.x {
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
|
||||
/* not ok */
|
||||
div :global {
|
||||
&.x {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue