2.0.2 • Published 7 years ago

@duuzra/icons v2.0.2

Weekly downloads
10
License
ISC
Repository
-
Last release
7 years ago

Duuzra Icons

This project contains all the custom icons in a font format.

Available Icons

  • Side note, gitlab are currently fixing the missing image issue shown below:

The prefix can be changed as stated below, but the following is an example with the default:

<ion-icon name="dz-lock"></ion-icon>
TitleNameContent CodeIcon
Add Contentdz-add-contente914npm.io
Add Folderdz-add-foldere900npm.io
Adddz-adde922npm.io
Addpeopledz-addpeoplee947npm.io
Address Fielddz-address-fielde90bnpm.io
Adhocdz-adhoce916npm.io
Agendadz-agendae923npm.io
Alldz-alle95cnpm.io
Analyticsdz-analyticse907npm.io
Ask A-questiondz-ask-a-questione937npm.io
Attachmentdz-attachmente917npm.io
Audiencedz-audiencee950npm.io
Builderdz-buildere908npm.io
Burger Menudz-burger-menue93fnpm.io
Caneditdz-canedite948npm.io
Cansharedz-cansharee949npm.io
Canviewdz-canviewe94anpm.io
Control Paneldz-control-panele909npm.io
Date Fielddz-date-fielde90cnpm.io
Delegatesdz-delegatese924npm.io
Desktopdz-desktope940npm.io
Directorydz-directorye925npm.io
Document Gallerydz-document-gallerye93anpm.io
Documentdz-documente926npm.io
Downloaddz-downloade95enpm.io
Draganddropdz-draganddrope95dnpm.io
Duplicatedz-duplicatee901npm.io
Editdz-edite961npm.io
Email Fielddz-email-fielde90dnpm.io
Excelfiledz-excelfilee95fnpm.io
Formsdz-formse927npm.io
Griddz-gride941npm.io
Homescreendz-homescreene902npm.io
Hotspotsdz-hotspotse928npm.io
Image Gallerydz-image-gallerye93bnpm.io
Imagesdz-imagese929npm.io
Infodz-infoe903npm.io
Ipadlandscapedz-ipadlandscapee943npm.io
Ipadportraitdz-ipadportraite944npm.io
Iphonelandscapedz-iphonelandscapee945npm.io
Iphoneportraitdz-iphoneportraite946npm.io
Label Fielddz-label-fielde90enpm.io
Languagesdz-languagese951npm.io
Launchdz-launche952npm.io
Linkeddz-linkede962npm.io
Listdz-liste942npm.io
Lockdz-locke918npm.io
Logindz-logine91enpm.io
Logoutdz-logoute915npm.io
Mastericondz-mastericone94bnpm.io
Multipleradio Fielddz-multipleradio-fielde90fnpm.io
Navigationdz-navigatione92anpm.io
New Duuzradz-new-duuzrae958npm.io
Nextdz-nexte919npm.io
Notesdz-notese938npm.io
Notificationsdz-notificationse91anpm.io
Number Fielddz-number-fielde910npm.io
Page Builderdz-page-buildere92bnpm.io
Pdffiledz-pdffilee959npm.io
Pollsdz-pollse92cnpm.io
Presentation Gallerydz-presentation-gallerye93cnpm.io
Presentationdz-presentatione92dnpm.io
Previousdz-previouse91bnpm.io
Profiledz-profilee90anpm.io
Publishdz-publishe91cnpm.io
Pushdz-pushe91dnpm.io
Rankingdz-rankinge963npm.io
Refreshdz-refreshe933npm.io
Resultsdz-resultse939npm.io
Savedz-savee934npm.io
Section Breakdz-section-breake964npm.io
Searchdz-searche935npm.io
Security Lockdz-security-locke953npm.io
Security Pindz-security-pine954npm.io
Security Urldz-security-urle955npm.io
Selected Option-tickdz-selected-option-ticke956npm.io
Settingsdz-settingse936npm.io
Singleradio Fielddz-singleradio-fielde911npm.io
Sliderdz-slidere965npm.io
Style Iconsdz-style-iconse932npm.io
Style Listdz-style-liste931npm.io
Tab Header-permissionsdz-tab-header-permissionse94cnpm.io
Tab Header-propertiesdz-tab-header-propertiese94dnpm.io
Table Row-closedz-table-row-closee94enpm.io
Templatedz-templatee904npm.io
Text Fielddz-text-fielde912npm.io
Textfiledz-textfilee95anpm.io
Timedz-timee966npm.io
Themedz-themee930npm.io
Thrash Deletedz-thrash-deletee905npm.io
Toggle Fielddz-toggle-fielde913npm.io
Toolboxdz-toolboxe91fnpm.io
Unlock Rightdz-unlock-righte960npm.io
Unlockdz-unlocke957npm.io
Uploaddz-uploade94fnpm.io
Upload Imagedz-uploade967fnpm.io
Uploadingdz-uploadinge93enpm.io
Usersdz-userse920npm.io
Video Gallerydz-video-gallerye93dnpm.io
Videodz-videoe92enpm.io
Visibledz-visiblee921npm.io
Webviewdz-webviewe92fnpm.io
Worddocdz-worddoce95bnpm.io
Zoomdz-zoome906npm.io

Development

Environment Setup

To make life easier during development you can use the npm link functionality. This will create a symbolic link between the target and dependent projects and will save you from having to push and pull every change. It will create a dependency to a local package without modifying package.json, you will also be able to modify the files of the package directly through the dependent application.

Given a folder structure similar to this:

duuzra
    duuzra_icons
        ...
    duuzra_app
        ...

navigate to the duuzra_app directory and run:

npm link ../duuzra_icons

This will then create the link between the types and app projects, you can verify this by going into the node_modules folder in the app and looking for @duuzra/icons. Any changes made to the icons project will be immediately reflected in the app project. Obviously this is not suitable for release, the normal method of linking is required here.

To remove the link, run the following:

npm rm @duuzra/icons

If the link still appears, then remove globally too:

npm rm -g @duuzra/icons

Important: If you have configured the npm link, deleting the node modules folder of the dependent application will also delete the files from the linked package. Be sure to unlink the package before deleting. A good process would be to only use the npm link when actively changing the icons project. As soon as the changes have been pushed to the repo, run the unlink command.

Building

Project Setup

Add the following to the package.json, it should be placed just above @duuzra/types in the devDependencies:

    "@duuzra/icons": "^1.0.*",

NPM install afterwards to make sure you get the latest icons. Running npm update will check for the latest version of both @duuzra/icons and @duuzra/types.

Create a config folder at the root of the project. Copy the following files into the new config folder:

node_modules/@ionic/app-scripts/config/copy.config.js
node_modules/@ionic/app-scripts/config/sass.config.js

This will allow us to modify the Ionic 2 build script to add in our new fonts. Edit copy.config.js and add the following to the bottom of the module.exports:

  copyDuuzraFonts: {
    src: ['{{ROOT}}/node_modules/@duuzra/icons/src/fonts/**/*'],
    dest: '{{WWW}}/assets/fonts'
  }

Edit sass.config.js and add the following to the bottom of the includePatohs:

    'node_modules/@duuzra/icons/src'

Then add the following to package.json, this should be added below "scripts":

  "scripts": {
    ...
  },
  "config": {
    "ionic_copy": "./config/copy.config.js",
    "ionic_sass": "./config/sass.config.js"
  },

SCSS Setup

Your project should now be copying the duuzra font and giving WebPack access to the @duuzra/icons scss. To add the icons to your Ionic 2 project you will need to add the following to the theme/variables.scss file:

$duuzra-font-path: "../assets/fonts";
$duuzra-prefix: "dz";
@import "duuzra.icons";

This should be added before the ionic.ionicons import.

IcoMoon

We use IcoMoon for the font generation. Import a new project, select src/Duuzra.json and load that project. Once the project has been uploaded, click on load.

Import SVG's to Set.

NB: the SVG filename will be the icon name, do not use spaces!

Once happy with the selected icons, generate font. Download the Zip file, extract the contents to a temporary folder. Replace the font files from the src/fonts directory with those from the temporary directory. Open the style.scss file and use the hash after the font file names, replacing the hash in the src/duuzra.icons.scss

Go back into the Projects on IcoMoon and download the project: Duuzra.json, replace the file in src/Duuzra.json.

Follow the regex instructions below.

Regex Replace

Sort IcoMoon scss variables: Sorter

Copy the contents of variables.scss from the temporary folder, excluding the header, sort the list using the above url. Copy the sorted list and paste it into a temporary scss file in VSCode and also replace the contents of src/variables.scss making sure you keep the header information.

In VSCode, do a find and replace on the temporary file:

# Find
(\$duuzra-icon-)([\S]+):\s[\S]+\n

# Replace
    &.ion-ios-#{$duuzra-prefix}-$2:before,\n    &.ion-md-#{$duuzra-prefix}-$2:before,\n    &[name*="#{$duuzra-prefix}-$2"]:before {\n        content: $1$2;\n    }\n\n

Copy the contents into src/icons.scss, replacing the contents inside ion-icon { }.

Undo the changes to the temporary file, now do another find and replace for the README.md file.

Replace the list of variables from IcoMoon into Available Icons Below:

# Find
(\$duuzra-icon-)([\S]+):\s\"([\S]+)";\n
# Replace
|$2|dz-$2|$3|![](./src/png/$2.png)|\n

Now copy the replaced information, open Chrome, bring up the console, enter a grave accent character into the console and then paste the contents of the temporary file, enter another grave accent character and then paste the below:

.replace(/^\|([\w-]+)/gm, function(str) { return '|' + str.replace('|', '').replace('-', ' ').replace(/\w\S*/g, function(txt) { return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); }); });

Copy the outputted text, excluing the " marks. Replace the code in the README.md

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago