-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor icon component to match formatting and extendability of othe…
…r components
- Loading branch information
1 parent
39794c9
commit 0464358
Showing
8 changed files
with
213 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,89 +5,151 @@ | |
|
||
@import 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200'; | ||
|
||
.material-symbols-outlined, | ||
.material-symbols { | ||
--op-mso-fill: 0; | ||
--op-mso-weight: var(--op-font-weight-normal); | ||
--op-mso-grade: 0; | ||
--op-mso-optical-sizing: 20; | ||
|
||
font-size: var(--op-font-medium); | ||
font-variation-settings: 'FILL' var(--op-mso-fill), 'wght' var(--op-mso-weight), 'GRAD' var(--op-mso-grade), | ||
'opsz' var(--op-mso-optical-sizing); | ||
line-height: var(--op-line-height-densest); | ||
vertical-align: middle; | ||
%icon-small-global { | ||
--__op-icon-font-size: var(--_op-icon-font-size-small); | ||
--__op-icon-optical-size: var(--_op-icon-optical-size-small); | ||
} | ||
|
||
// Fill | ||
.icon--outlined { | ||
--op-mso-fill: 0; | ||
%icon-medium-global { | ||
--__op-icon-font-size: var(--_op-icon-font-size-medium); | ||
--__op-icon-optical-size: var(--_op-icon-optical-size-medium); | ||
} | ||
|
||
.icon--filled { | ||
--op-mso-fill: 1; | ||
%icon-large-global { | ||
--__op-icon-font-size: var(--_op-icon-font-size-large); | ||
--__op-icon-optical-size: var(--_op-icon-optical-size-large); | ||
} | ||
|
||
// Weight | ||
.icon--weight-light { | ||
--op-mso-weight: var(--op-font-weight-light); | ||
%icon-x-large-global { | ||
--__op-icon-font-size: var(--_op-icon-font-size-x-large); | ||
--__op-icon-optical-size: var(--_op-icon-optical-size-x-large); | ||
} | ||
|
||
.icon--weight-normal { | ||
--op-mso-weight: var(--op-font-weight-normal); | ||
%icon-weight-light-global { | ||
--__op-icon-weight: var(--_op-icon-weight-light); | ||
} | ||
|
||
.icon--weight-semi-bold { | ||
--op-mso-weight: var(--op-font-weight-semi-bold); | ||
%icon-weight-normal-global { | ||
--__op-icon-weight: var(--_op-icon-weight-normal); | ||
} | ||
|
||
.icon--weight-bold { | ||
--op-mso-weight: var(--op-font-weight-bold); | ||
%icon-weight-semi-bold-global { | ||
--__op-icon-weight: var(--_op-icon-weight-semi-bold); | ||
} | ||
|
||
// Emphasis | ||
.icon--low-emphasis { | ||
--op-mso-grade: -20; | ||
%icon-weight-bold-global { | ||
--__op-icon-weight: var(--_op-icon-weight-bold); | ||
} | ||
|
||
.icon--normal-emphasis { | ||
--op-mso-grade: 0; | ||
} | ||
%icon-global { | ||
// Public API (allowed to be overridden) | ||
// Weight | ||
--_op-icon-weight-light: var(--op-font-weight-light); | ||
--_op-icon-weight-normal: var(--op-font-weight-normal); | ||
--_op-icon-weight-semi-bold: var(--op-font-weight-semi-bold); | ||
--_op-icon-weight-bold: var(--op-font-weight-bold); | ||
|
||
.icon--high-emphasis { | ||
--op-mso-grade: 200; | ||
} | ||
// Fill | ||
--_op-icon-fill-outlined: 0; | ||
--_op-icon-fill-filled: 1; | ||
|
||
// Size | ||
.icon--medium { | ||
font-size: var(--op-font-medium); | ||
// Emphasis | ||
--_op-icon-emphasis-low: -20; | ||
--_op-icon-emphasis-normal: 0; | ||
--_op-icon-emphasis-high: 200; | ||
|
||
--op-mso-optical-sizing: 20; | ||
} | ||
// Size | ||
--_op-icon-font-size-small: var(--op-font-small); | ||
--_op-icon-font-size-medium: var(--op-font-medium); | ||
--_op-icon-font-size-large: var(--op-font-large); | ||
--_op-icon-font-size-x-large: var(--op-font-2x-large); | ||
--_op-icon-optical-size-small: 20; | ||
--_op-icon-optical-size-medium: 20; | ||
--_op-icon-optical-size-large: 40; | ||
--_op-icon-optical-size-x-large: 48; | ||
|
||
.icon--large { | ||
font-size: var(--op-font-large); | ||
// Private API (don't touch these) | ||
--__op-icon-weight: var(--_op-icon-weight-normal); | ||
--__op-icon-fill: var(--_op-icon-fill-outlined); | ||
--__op-icon-emphasis: var(--_op-icon-emphasis-normal); | ||
--__op-icon-font-size: var(--_op-icon-font-size-medium); | ||
--__op-icon-optical-size: var(--_op-icon-optical-size-medium); | ||
|
||
--op-mso-optical-sizing: 40; | ||
} | ||
font-size: var(--__op-icon-font-size); | ||
font-variation-settings: 'FILL' var(--__op-icon-fill), 'wght' var(--__op-icon-weight), | ||
'GRAD' var(--__op-icon-emphasis), 'opsz' var(--__op-icon-optical-size); | ||
line-height: var(--op-line-height-densest); | ||
vertical-align: middle; | ||
|
||
// Fill Modifiers | ||
&.icon--outlined { | ||
--__op-icon-fill: var(--_op-icon-fill-outlined); | ||
} | ||
|
||
&.icon--filled { | ||
--__op-icon-fill: var(--_op-icon-fill-filled); | ||
} | ||
|
||
// Weight Modifiers | ||
&.icon--weight-light { | ||
@extend %icon-weight-light-global; | ||
} | ||
|
||
&.icon--weight-normal { | ||
@extend %icon-weight-normal-global; | ||
} | ||
|
||
&.icon--weight-semi-bold { | ||
@extend %icon-weight-semi-bold-global; | ||
} | ||
|
||
&.icon--weight-bold { | ||
@extend %icon-weight-bold-global; | ||
} | ||
|
||
// Emphasis | ||
&.icon--low-emphasis { | ||
--__op-icon-emphasis: var(--_op-icon-emphasis-low); | ||
} | ||
|
||
&.icon--normal-emphasis { | ||
--__op-icon-emphasis: var(--_op-icon-emphasis-normal); | ||
} | ||
|
||
&.icon--high-emphasis { | ||
--__op-icon-emphasis: var(--_op-icon-emphasis-high); | ||
} | ||
|
||
// Size Modifiers | ||
&.icon--small { | ||
@extend %icon-small-global; | ||
} | ||
|
||
&.icon--medium { | ||
@extend %icon-medium-global; | ||
} | ||
|
||
.icon--x-large { | ||
font-size: var(--op-font-2x-large); | ||
&.icon--large { | ||
@extend %icon-large-global; | ||
} | ||
|
||
--op-mso-optical-sizing: 48; | ||
&.icon--x-large { | ||
@extend %icon-x-large-global; | ||
} | ||
} | ||
|
||
.material-symbols-outlined, | ||
.material-symbols { | ||
@extend %icon-global; | ||
} | ||
|
||
.custom-icons { | ||
@extend %icon-global; | ||
|
||
display: inline-block; | ||
width: var(--op-font-2x-large); | ||
height: var(--op-font-2x-large); | ||
|
||
&.icon--medium { | ||
font-size: var(--op-font-small); | ||
|
||
--op-mso-optical-sizing: 20; | ||
} | ||
|
||
&.icon--large { | ||
width: var(--op-font-large); | ||
height: var(--op-font-large); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters