mirror of
				https://github.com/elyby/accounts-frontend.git
				synced 2025-05-31 14:11:58 +05:30 
			
		
		
		
	Возможность импортить классы иконок через sass
This commit is contained in:
		@@ -1,12 +0,0 @@
 | 
			
		||||
import icons from 'icons.font.json';
 | 
			
		||||
 | 
			
		||||
const baseClass = 'icon';
 | 
			
		||||
 | 
			
		||||
export default Object.keys(icons)
 | 
			
		||||
    .filter((icon) => icon !== baseClass)
 | 
			
		||||
    .reduce((acc, icon) => {
 | 
			
		||||
        acc[icon.replace(`${baseClass}-`, '')] = `${icons[baseClass]} ${icons[icon]}`;
 | 
			
		||||
 | 
			
		||||
        return acc;
 | 
			
		||||
    }, {})
 | 
			
		||||
    ;
 | 
			
		||||
							
								
								
									
										10
									
								
								src/components/ui/icons.scss
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								src/components/ui/icons.scss
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
@import '~icons.font.json';
 | 
			
		||||
 | 
			
		||||
.arrowLeft {
 | 
			
		||||
    composes: arrow;
 | 
			
		||||
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    transform: rotate(90deg);
 | 
			
		||||
 | 
			
		||||
    font-size: 24px;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										25
									
								
								src/icons.css.hbs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								src/icons.css.hbs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
@font-face {
 | 
			
		||||
	font-family: "{{fontName}}";
 | 
			
		||||
	src: {{{src}}};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.{{baseClass}} {
 | 
			
		||||
	line-height: 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.{{baseClass}}:before {
 | 
			
		||||
	font-family: {{fontName}} !important;
 | 
			
		||||
	font-style: normal;
 | 
			
		||||
	font-weight: normal !important;
 | 
			
		||||
	vertical-align: top;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
{{#each codepoints}}
 | 
			
		||||
.{{../classPrefix}}{{@key}} {
 | 
			
		||||
    composes: {{../baseClass}};
 | 
			
		||||
 | 
			
		||||
    &:before {
 | 
			
		||||
        content: "\\{{this}}";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
{{/each}}
 | 
			
		||||
@@ -1,6 +1,9 @@
 | 
			
		||||
{
 | 
			
		||||
    "files": ["icons/webfont/*"],
 | 
			
		||||
    "fileName": "[fontname][ext]",
 | 
			
		||||
    "fontName": "ely-account-icons",
 | 
			
		||||
    "cssTemplate": "icons.css.hbs",
 | 
			
		||||
    "classPrefix": "",
 | 
			
		||||
    "fixedWidth": true,
 | 
			
		||||
    "normalize": true
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user