Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Commit

Permalink
fix: converted every style to global
Browse files Browse the repository at this point in the history
  • Loading branch information
TheComputerM committed Sep 15, 2020
1 parent 608d2a2 commit f2cc52f
Show file tree
Hide file tree
Showing 27 changed files with 188 additions and 220 deletions.
20 changes: 9 additions & 11 deletions packages/svelte-materialify/src/components/Alert/Alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,17 @@
color: map-deep-get($material-dark-theme, 'text', 'primary');
}

:global {
.s-icon,
.s-btn {
color: inherit !important;
}
.s-icon,
.s-btn {
color: inherit !important;
}

.s-icon {
align-self: flex-start;
}
.s-icon {
align-self: flex-start;
}

[slot='icon'] {
margin-right: $spacer * 4;
}
[slot='icon'] {
margin-right: $spacer * 4;
}

.s-alert__border {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}
</script>

<style lang="scss" src="./Alert.scss">
<style lang="scss" src="./Alert.scss" global>
</style>

{#if visible}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
z-index: 0;
padding: 4px;

:global(.s-btn.fab) {
.s-btn.fab {
width: 48px;
height: 48px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
export let style = '';
</script>

<style lang="scss" src="./AppBar.scss">
<style lang="scss" src="./AppBar.scss" global>
</style>

<header
Expand Down
22 changes: 10 additions & 12 deletions packages/svelte-materialify/src/components/Avatar/Avatar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
color: map-deep-get($material-dark-theme, 'text', 'primary');
}

:global {
.s-icon,
img,
svg {
color: inherit;
border-radius: inherit;
display: inline-flex;
height: inherit;
width: inherit;
}
}

&:not(.tile) {
border-radius: $avatar-border-radius;
}

.s-icon,
img,
svg {
color: inherit;
border-radius: inherit;
display: inline-flex;
height: inherit;
width: inherit;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
export let style = '';
</script>

<style lang="scss" src="./Avatar.scss">
<style lang="scss" src="./Avatar.scss" global>
</style>

<div class="s-avatar {klass}" class:tile use:Style={{ 'avatar-size': size }} {style}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
margin: $breadcrumbs-margin;
padding: $breadcrumbs-padding;

:global {
.s-breadcrumb-item {
align-items: center;
display: inline-flex;
text-decoration: none;

&.disabled {
color: var(--theme-text-disabled);
pointer-events: none;
}
.s-breadcrumb-item {
align-items: center;
display: inline-flex;
text-decoration: none;

&.disabled {
color: var(--theme-text-disabled);
pointer-events: none;
}
}

Expand All @@ -27,7 +25,7 @@
display: inline-flex;
font-size: $breadcrumbs-item-font-size;

:global(.s-icon) {
.s-icon {
font-size: $breadcrumbs-item-large-font-size;
}

Expand All @@ -44,7 +42,7 @@
li {
font-size: $breadcrumbs-item-large-font-size;

:global(.s-icon) {
.s-icon {
font-size: $breadcrumbs-item-large-font-size;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
items = items.map((x) => ({ ...defaults, ...x }));
</script>

<style lang="scss" src="./Breadcrumbs.scss">
<style lang="scss" src="./Breadcrumbs.scss" global>
</style>

<ul class="s-breadcrumbs {klass}" class:large>
Expand Down
10 changes: 4 additions & 6 deletions packages/svelte-materialify/src/components/Button/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
transition-property: box-shadow, transform, opacity;
background-color: var(--theme-app-bar);

:global {
a,
.s-icon {
color: inherit;
}
a,
.s-icon {
color: inherit;
}

.s-btn__content {
Expand Down Expand Up @@ -148,7 +146,7 @@
min-height: 0;
padding: 0;
@each $name, $size in $fab-icon-sizes {
&.size-#{$name} :global(.s-icon) {
&.size-#{$name} .s-icon {
font-size: #{$size}px;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@
transition: $primary-transition;

&:not(.elevated) {
:global {
.s-btn-group-item.s-btn {
box-shadow: none;
}
.s-btn-group-item.s-btn {
box-shadow: none;
}
}

&.borderless {
:global {
.s-btn-group-item.s-btn {
border-width: 0;
}
.s-btn-group-item.s-btn {
border-width: 0;
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/svelte-materialify/src/components/Card/Card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@
pointer-events: none;
user-select: none;

> :global(*:not(.s-progress-linear)) {
> *:not(.s-progress-linear) {
opacity: $card-disabled-opacity;
transition: inherit;
}
}

> :global(*:first-child:not(.s-btn):not(.s-chip)) {
> *:first-child:not(.s-btn):not(.s-chip) {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
export { klass as class };
</script>

<style lang="scss" src="./Card.scss">
<style lang="scss" src="./Card.scss" global>
</style>

<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
display: flex;
padding: $card-actions-padding;

:global(.s-btn) {
.s-btn {
padding: $card-btn-padding;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export { klass as class };
</script>

<style lang="scss" src="./CardActions.scss">
<style lang="scss" src="./CardActions.scss" global>
</style>

<div class="s-card-actions {klass}" {style}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
letter-spacing: $card-text-letter-spacing;
padding: $card-subtitle-padding;

+ :global(.s-card-text) {
+ .s-card-text {
padding-top: $card-adjacent-sibling-text-padding-top;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export { klass as class };
</script>

<style lang="scss" src="./CardSubtitle.scss">
<style lang="scss" src="./CardSubtitle.scss" global>
</style>

<div class="s-card-subtitle {klass}" {style}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export { klass as class };
</script>

<style lang="scss" src="./CardText.scss">
<style lang="scss" src="./CardText.scss" global>
</style>

<div class="s-card-text {klass}" {style}>
Expand Down
16 changes: 7 additions & 9 deletions packages/svelte-materialify/src/components/Card/CardTitle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
word-break: $card-title-word-break;
padding: $card-subtitle-padding;

:global {
+ .s-card-subtitle,
+ .s-card-title {
padding-top: $card-adjacent-sibling-text-padding-top;
margin-top: $card-title-adjacent-sibling-subtitle-margin-top;
}
+ .s-card-subtitle,
+ .s-card-title {
padding-top: $card-adjacent-sibling-text-padding-top;
margin-top: $card-title-adjacent-sibling-subtitle-margin-top;
}

+ .s-card-subtitle {
margin-top: $card-title-adjacent-sibling-subtitle-margin-top;
}
+ .s-card-subtitle {
margin-top: $card-title-adjacent-sibling-subtitle-margin-top;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
export { klass as class };
</script>

<style lang="scss" src="./CardTitle.scss">
<style lang="scss" src="./CardTitle.scss" global>
</style>

<div class="s-card-title {klass}" {style}>
Expand Down
72 changes: 33 additions & 39 deletions packages/svelte-materialify/src/components/Chip/Chip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
.s-chip__close {
cursor: pointer;

:global {
.s-icon {
font-size: $chip-close-size;
max-height: $chip-close-size;
max-width: $chip-close-size;
user-select: none;
}
.s-icon {
font-size: $chip-close-size;
max-height: $chip-close-size;
max-width: $chip-close-size;
user-select: none;
}

&:focus,
Expand Down Expand Up @@ -51,30 +49,28 @@
top: 0;
}

:global {
.s-avatar {
height: $chip-avatar-size !important;
min-width: $chip-avatar-size !important;
width: $chip-avatar-size !important;
}
.s-avatar {
height: $chip-avatar-size !important;
min-width: $chip-avatar-size !important;
width: $chip-avatar-size !important;
}

.s-icon {
font-size: $chip-icon-size;
}
.s-icon {
font-size: $chip-icon-size;
}

.s-icon,
.s-avatar {
color: inherit;
.s-icon,
.s-avatar {
color: inherit;

&:first-child {
margin-left: $chip-icon-margin-before;
margin-right: $chip-icon-margin-after;
}
&:first-child {
margin-left: $chip-icon-margin-before;
margin-right: $chip-icon-margin-after;
}

&:last-child {
margin-left: $chip-icon-margin-after;
margin-right: $chip-icon-margin-before;
}
&:last-child {
margin-left: $chip-icon-margin-after;
margin-right: $chip-icon-margin-before;
}
}

Expand All @@ -97,18 +93,16 @@
}

&.pill {
:global {
.s-avatar {
height: $chip-pill-avatar-size !important;
width: $chip-pill-avatar-size !important;

&:first-child {
margin-left: $chip-pill-avatar-margin-before;
}

&:last-child {
margin-right: $chip-pill-avatar-margin-before;
}
.s-avatar {
height: $chip-pill-avatar-size !important;
width: $chip-pill-avatar-size !important;

&:first-child {
margin-left: $chip-pill-avatar-margin-before;
}

&:last-child {
margin-right: $chip-pill-avatar-margin-before;
}
}
}
Expand Down
Loading

0 comments on commit f2cc52f

Please sign in to comment.