mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
refactor!: use :global()
for custom styles (#1940)
* Prefix custom class selectors with `bx--` (primarily used in custom UI Shell components) * Use `:global` scope so that selector names are not hashed
This commit is contained in:
parent
c1e0d7a3b8
commit
d5a11489f8
6 changed files with 70 additions and 49 deletions
|
@ -70,7 +70,7 @@
|
|||
type="button"
|
||||
class:bx--header__action="{true}"
|
||||
class:bx--header__action--active="{isOpen}"
|
||||
class:action-text="{text}"
|
||||
class:bx--header__action--text="{text}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:click|stopPropagation="{() => {
|
||||
|
@ -88,7 +88,7 @@
|
|||
</slot>
|
||||
{/if}
|
||||
<slot name="text">
|
||||
{#if text}<span>{text}</span>{/if}
|
||||
{#if text}<span class:bx--header__action-text="{true}">{text}</span>{/if}
|
||||
</slot>
|
||||
</button>
|
||||
{#if isOpen}
|
||||
|
@ -106,7 +106,7 @@
|
|||
{/if}
|
||||
|
||||
<style>
|
||||
.action-text {
|
||||
:global(.bx--header__action--text) {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
width: auto;
|
||||
|
@ -123,7 +123,7 @@
|
|||
color: #f4f4f4;
|
||||
}
|
||||
|
||||
.action-text > span {
|
||||
:global(.bx--header__action-text) {
|
||||
margin-left: 0.75rem;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue