-
1 Mar 2013 6:37 AM #1
Answered: can anyone help me include icons from pictos with app.scss ?
Answered: can anyone help me include icons from pictos with app.scss ?
I just download sdk 2.2.0-b1, and I found the old function @include pictos-iconmask($name) is deprecated. So I replace with "@include icon($name)". I got some "strange" button icons like :
Sans titre.png however I just included settings3 and chat3 from pictos file.
Here's my app.scss:
And I use my icons like this :Code:$include-default-icons: false; //import the sencha touch theme @import 'sencha-touch/base'; @import 'sencha-touch/base/all'; @import 'sencha-touch/default'; @import 'sencha-touch/default/all'; @include icon('settings3'); @include icon('chat3');
All suggestions are welcome !Code:{ xtype:'button', iconCls: 'chat3', iconMask: true, align:'right' }, { xtype:'button', iconCls: 'settings3', iconMask: true, align:'right' },
-
Best Answer Posted by markevans
....
If you include the following css in your app, either in your index.html or probably better in the custom code section of your app.scss file, and change the "content" to the appropriate letter from the pictos website you can at least reliably use the ones they define there.
I have no idea whether we have access to more than this using pictos.
The above is a white "x" in a black circle. I was able to get the "calendar" picto working this way as it does not currently work in 2.2b.Code:.x-button-icon.[iconCls_name_you_want]:before,.x-button .x-button-icon.[iconCls_name_you_want]: before { position:absolute; top:0; right:0; bottom:0; left:0; text-align:center; content:"D" }
Pictos website with mapping is at http://pictos.cc/font/.
-
16 Mar 2013 1:53 PM #2
Same problem.
Same problem.
I upgraded to 2.2 to help with another problem. Now, several of my icons are behaving like this as well. In addition, my custom image icon is not working.
-
16 Mar 2013 2:44 PM #3
This helps a bit...
This helps a bit...
....
If you include the following css in your app, either in your index.html or probably better in the custom code section of your app.scss file, and change the "content" to the appropriate letter from the pictos website you can at least reliably use the ones they define there.
I have no idea whether we have access to more than this using pictos.
The above is a white "x" in a black circle. I was able to get the "calendar" picto working this way as it does not currently work in 2.2b.Code:.x-button-icon.[iconCls_name_you_want]:before,.x-button .x-button-icon.[iconCls_name_you_want]: before { position:absolute; top:0; right:0; bottom:0; left:0; text-align:center; content:"D" }
Pictos website with mapping is at http://pictos.cc/font/.Last edited by markevans; 16 Mar 2013 at 2:45 PM. Reason: include link to pictos website.
-
16 Mar 2013 3:03 PM #4
I'm having the same issue, but my icons were bleeding vertically. The following fixed my issue. Perhaps something similar would help.
Code:// fixes scewing of icons when docked .x-button.x-docked-right, .x-button.x-docked-left { padding-top: 0.5em !important; }
-
18 Mar 2013 1:15 AM #5
I tried your proposition, and I got my icons correctly shown. However, I can only put the icons available on the site http://pictos.cc/font/. in the content attribute.
now I've two questions;
1) how can we put an icon from the theme/pictos ?
2) if I want to put a customized icon made by myself, how can I do it ?
-
26 Mar 2013 10:37 AM #6
Got solution? can anyone post the full example? I facing same problem
-
26 Mar 2013 8:07 PM #7
I try tis
But when i try compass compile, it return error "Invalid css..."Code:.x-button-icon.[member]:before,.x-button .x-button-icon.[member]: before { position:absolute; top:0; right:0; bottom:0; left:0; text-align:center; content:"D" }
-
26 Mar 2013 9:45 PM #8
Wasn't sure if you were aware that pictos is already part of the Sencha Touch package. There are over 300 vector icons found in your touch build @ resources/themes/images/default/pictos
In ST 2.1.1 the icons need to be individually registered in your app.scss file. I hear this is unneeded in the latest release.
// For example:
@include pictos-iconmask(refresh1);
... will include refresh1.png with the project which afterwards can be used as such:
Code:Ext.define('MyApp.view.WebToolbar', { extend: 'Ext.Toolbar', alias: 'widget.webtoolbar', config: { docked: 'top', items: [ { xtype: 'button', docked: 'right', ui: 'plain', iconCls: 'delete', iconMask: true }, { xtype: 'button', docked: 'right', ui: 'plain', iconCls: 'refresh1', iconMask: true }, { xtype: 'button', docked: 'left', ui: 'plain', iconCls: 'arrow_left', iconMask: true } ] } });
-
27 Mar 2013 12:09 AM #9
I'm sorry, but I don't find anything wrong, it seems correct your code...
I finally put just a line of code :
@include icon("chat2");
and it works. However, it's not for all icons in the pictos folder, some of them give a series of icons. For example, 'chat3' exists in the folder, but when I compile the scss, it gives a series of icons which represents 'c' 'h' 'a' 't' '3' on the site pictos. I included 'chat2' but in reality it shows 'chat3.png'...
-
5 Apr 2013 6:45 AM #10
Anybody found how to include a custom pictos in version 2.2 ? My question is for st 2.2 and not 2.1, and for custom icon.


Reply With Quote