GithubHelp home page GithubHelp logo

isabella232 / senchatouch-windowsphone-fontface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from katzer/senchatouch-windowsphone-fontface

0.0 0.0 0.0 152 KB

@font-face replacement for Sencha Touch on Windows Phone

License: MIT License

CSS 100.00%

senchatouch-windowsphone-fontface's Introduction

senchatouch-windowsphone-fontface

Windows Phone does not allow to specify @font-faces if the page was loaded via file: protocol, e.g if the page is hosted locally on the phone itself.

Since Sencha Touch uses @font-faces to display icons, only the content letter will be visible on Windows Phone.

As the only workaround all icons has to be loaded as background images instead.

Windows Phone 8.1

The issue has been resolved with Windows Phone 8.1 and IE11.

Sass configuration

1. Exclude pictos font and default icons

$include-pictos-font: false;
$include-default-icons: false;

2. Import the variables for windows

@import "sencha-touch/windows";
@import "sencha-touch/default";

3. Import the mixin

@import "stylesheets/mixins/windowsphone-icon";

4. Include the icons you need

@include windowsphone-icon("home", "icons/home.png");
@include windowsphone-icon("star", "icons/star.png", "icons/star_active.png");

Sass mixin

@mixin windowsphone-icon($name, $icon, $active-icon: null) {
	.x-tab .x-button-icon.#{$name}:before,
	.x-button .x-button-icon.#{$name}:before {
		content: none;
	}

	.x-tab .x-button-icon.#{$name} {
		background-size: 65%;
		background-position: 6px 6px;
	}

	.x-button-icon.#{$name} {
		background-image: theme_image("../../../../resources/", #{$icon});
		background-repeat: no-repeat;
		background-size: contain;
	}

	@if $active-icon != null {
		.x-tab-active .x-button-icon.#{$name},
		.x-tab-pressed .x-button-icon.#{$name},
		.x-button-pressing .x-button-icon.#{$name} {
			background-image: theme_image("../../../../resources/", #{$active-icon});
		}
	}
}

License

This source code is released under the MIT License.

senchatouch-windowsphone-fontface's People

Contributors

katzer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.