|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var TYPES = require('../parsers').TYPES;
|
|---|
| 4 | var valueType = require('../parsers').valueType;
|
|---|
| 5 | var shorthandParser = require('../parsers').shorthandParser;
|
|---|
| 6 | var shorthandSetter = require('../parsers').shorthandSetter;
|
|---|
| 7 | var shorthandGetter = require('../parsers').shorthandGetter;
|
|---|
| 8 |
|
|---|
| 9 | var shorthand_for = {
|
|---|
| 10 | 'font-family': require('./fontFamily'),
|
|---|
| 11 | 'font-size': require('./fontSize'),
|
|---|
| 12 | 'font-style': require('./fontStyle'),
|
|---|
| 13 | 'font-variant': require('./fontVariant'),
|
|---|
| 14 | 'font-weight': require('./fontWeight'),
|
|---|
| 15 | 'line-height': require('./lineHeight'),
|
|---|
| 16 | };
|
|---|
| 17 |
|
|---|
| 18 | var static_fonts = [
|
|---|
| 19 | 'caption',
|
|---|
| 20 | 'icon',
|
|---|
| 21 | 'menu',
|
|---|
| 22 | 'message-box',
|
|---|
| 23 | 'small-caption',
|
|---|
| 24 | 'status-bar',
|
|---|
| 25 | 'inherit',
|
|---|
| 26 | ];
|
|---|
| 27 |
|
|---|
| 28 | var setter = shorthandSetter('font', shorthand_for);
|
|---|
| 29 |
|
|---|
| 30 | module.exports.definition = {
|
|---|
| 31 | set: function(v) {
|
|---|
| 32 | var short = shorthandParser(v, shorthand_for);
|
|---|
| 33 | if (short !== undefined) {
|
|---|
| 34 | return setter.call(this, v);
|
|---|
| 35 | }
|
|---|
| 36 | if (valueType(v) === TYPES.KEYWORD && static_fonts.indexOf(v.toLowerCase()) !== -1) {
|
|---|
| 37 | this._setProperty('font', v);
|
|---|
| 38 | }
|
|---|
| 39 | },
|
|---|
| 40 | get: shorthandGetter('font', shorthand_for),
|
|---|
| 41 | enumerable: true,
|
|---|
| 42 | configurable: true,
|
|---|
| 43 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.