@bbc/psammead-styles
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -6,2 +6,3 @@ # @bbc/psammead-styles Changelog | ||
|---------|-------------| | ||
| 1.1.0 | [PR#764](https://github.com/bbc/psammead/pull/764) Add function to get serif bold font | | ||
| 1.0.1 | [PR#677](https://github.com/bbc/psammead/pull/677) Use `@bbc/gel-foundations@3.0.0` | | ||
@@ -8,0 +9,0 @@ | 1.0.0 | [PR#679](https://github.com/bbc/psammead/pull/679) Bump version number | |
@@ -10,10 +10,16 @@ "use strict"; | ||
var reithSerif = "font-family: ReithSerif, ".concat(reithFallback); | ||
var getFontStyleAndWeight = function getFontStyleAndWeight(style, weight) { | ||
return "font-weight: ".concat(weight, ";\n font-style: ").concat(style, ";"); | ||
}; | ||
var news = { | ||
sansRegular: "\n ".concat(reithSans, " \n font-style: normal;\n font-weight: 400;\n "), | ||
sansItalic: "\n ".concat(reithSans, "\n font-style: italic;\n font-weight: 400;\n "), | ||
sansBold: "\n ".concat(reithSans, "\n font-style: normal;\n font-weight: 700;\n "), | ||
sansBoldItalic: "\n ".concat(reithSans, "\n font-style: italic;\n font-weight: 700;\n "), | ||
serifRegular: "\n ".concat(reithSerif, ",\n font-style: normal;\n font-weight: 400;\n "), | ||
serifMedium: "\n ".concat(reithSerif, " \n font-style: normal;\n font-weight: 500;\n "), | ||
serifMediumItalic: "\n ".concat(reithSerif, " \n font-style: italic;\n font-weight: 500;\n ") | ||
sansRegular: "\n ".concat(reithSans, "\n ").concat(getFontStyleAndWeight('normal', 400), " \n "), | ||
sansItalic: "\n ".concat(reithSans, "\n ").concat(getFontStyleAndWeight('italic', 400), " \n "), | ||
sansBold: "\n ".concat(reithSans, "\n ").concat(getFontStyleAndWeight('normal', 700), "\n "), | ||
sansBoldItalic: "\n ".concat(reithSans, "\n ").concat(getFontStyleAndWeight('italic', 700), "\n "), | ||
serifRegular: "\n ".concat(reithSerif, "\n ").concat(getFontStyleAndWeight('normal', 400), "\n "), | ||
serifMedium: "\n ".concat(reithSerif, "\n ").concat(getFontStyleAndWeight('italic', 500), " \n "), | ||
serifMediumItalic: "\n ".concat(reithSerif, "\n ").concat(getFontStyleAndWeight('italic', 500), "\n "), | ||
serifBold: "\n ".concat(reithSerif, "\n ").concat(getFontStyleAndWeight('normal', 700), "\n ") | ||
}; | ||
@@ -23,11 +29,11 @@ exports.news = news; | ||
var helmetFontStyles = { | ||
sansRegular: "\n ".concat(helmet, "\n font-weight: 400;\n font-style: normal;\n "), | ||
sansItalic: "\n ".concat(helmet, "\n font-weight: 400;\n font-style: italic;\n "), | ||
sansBold: "\n ".concat(helmet, "\n font-weight: 700;\n font-style: normal;\n "), | ||
sansBoldItalic: "\n ".concat(helmet, "\n font-weight: 700;\n font-style: italic;\n ") | ||
sansRegular: "\n ".concat(helmet, "\n ").concat(getFontStyleAndWeight('normal', 400), "\n "), | ||
sansItalic: "\n ".concat(helmet, "\n ").concat(getFontStyleAndWeight('italic', 400), "\n "), | ||
sansBold: "\n ".concat(helmet, "\n ").concat(getFontStyleAndWeight('normal', 700), "\n "), | ||
sansBoldItalic: "\n ".concat(helmet, "\n ").concat(getFontStyleAndWeight('italic', 700), "\n ") | ||
}; | ||
var nassimPersian = "font-family: NassimPersian, Arial, Verdana, Geneva, Helvetica, sans serif;"; | ||
var persianStyles = { | ||
sansRegular: "\n ".concat(nassimPersian, "\n font-style: normal;\n font-weight: 400;\n "), | ||
sansBold: "\n ".concat(nassimPersian, " \n font-style: normal;\n font-weight: 700;\n ") | ||
sansRegular: "\n ".concat(nassimPersian, "\n ").concat(getFontStyleAndWeight('normal', 400), "\n "), | ||
sansBold: "\n ".concat(nassimPersian, "\n ").concat(getFontStyleAndWeight('normal', 700), "\n ") | ||
}; | ||
@@ -34,0 +40,0 @@ var persian = persianStyles; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.getSerifMediumItalic = exports.getSerifMedium = exports.getSerifRegular = exports.getSansBoldItalic = exports.getSansBold = exports.getSansItalic = exports.getSansRegular = void 0; | ||
exports.getSerifBold = exports.getSerifMediumItalic = exports.getSerifMedium = exports.getSerifRegular = exports.getSansBoldItalic = exports.getSansBold = exports.getSansItalic = exports.getSansRegular = void 0; | ||
@@ -91,2 +91,13 @@ var fonts = _interopRequireWildcard(require("./font-families")); | ||
exports.getSerifMediumItalic = getSerifMediumItalic; | ||
exports.getSerifMediumItalic = getSerifMediumItalic; | ||
var getSerifBold = function getSerifBold(service) { | ||
if (!fonts[service]) { | ||
return null; | ||
} | ||
var serifBold = fonts[service].serifBold; | ||
return serifBold || getSansBold(service); | ||
}; | ||
exports.getSerifBold = getSerifBold; |
{ | ||
"name": "@bbc/psammead-styles", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A collection of string constants for use in CSS, containing non-GEL styling details that are bespoke to specific BBC services and products.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -5,38 +5,39 @@ const reithFallback = `Helvetica, Arial, sans-serif;`; | ||
const getFontStyleAndWeight = (style, weight) => | ||
`font-weight: ${weight}; | ||
font-style: ${style};`; | ||
export const news = { | ||
sansRegular: ` | ||
${reithSans} | ||
font-style: normal; | ||
font-weight: 400; | ||
${reithSans} | ||
${getFontStyleAndWeight('normal', 400)} | ||
`, | ||
sansItalic: ` | ||
${reithSans} | ||
font-style: italic; | ||
font-weight: 400; | ||
${getFontStyleAndWeight('italic', 400)} | ||
`, | ||
sansBold: ` | ||
${reithSans} | ||
font-style: normal; | ||
font-weight: 700; | ||
${getFontStyleAndWeight('normal', 700)} | ||
`, | ||
sansBoldItalic: ` | ||
${reithSans} | ||
font-style: italic; | ||
font-weight: 700; | ||
${getFontStyleAndWeight('italic', 700)} | ||
`, | ||
serifRegular: ` | ||
${reithSerif}, | ||
font-style: normal; | ||
font-weight: 400; | ||
${reithSerif} | ||
${getFontStyleAndWeight('normal', 400)} | ||
`, | ||
serifMedium: ` | ||
${reithSerif} | ||
font-style: normal; | ||
font-weight: 500; | ||
${reithSerif} | ||
${getFontStyleAndWeight('italic', 500)} | ||
`, | ||
serifMediumItalic: ` | ||
${reithSerif} | ||
font-style: italic; | ||
font-weight: 500; | ||
${reithSerif} | ||
${getFontStyleAndWeight('italic', 500)} | ||
`, | ||
serifBold: ` | ||
${reithSerif} | ||
${getFontStyleAndWeight('normal', 700)} | ||
`, | ||
}; | ||
@@ -49,19 +50,15 @@ | ||
${helmet} | ||
font-weight: 400; | ||
font-style: normal; | ||
${getFontStyleAndWeight('normal', 400)} | ||
`, | ||
sansItalic: ` | ||
${helmet} | ||
font-weight: 400; | ||
font-style: italic; | ||
${getFontStyleAndWeight('italic', 400)} | ||
`, | ||
sansBold: ` | ||
${helmet} | ||
font-weight: 700; | ||
font-style: normal; | ||
${getFontStyleAndWeight('normal', 700)} | ||
`, | ||
sansBoldItalic: ` | ||
${helmet} | ||
font-weight: 700; | ||
font-style: italic; | ||
${getFontStyleAndWeight('italic', 700)} | ||
`, | ||
@@ -75,9 +72,7 @@ }; | ||
${nassimPersian} | ||
font-style: normal; | ||
font-weight: 400; | ||
${getFontStyleAndWeight('normal', 400)} | ||
`, | ||
sansBold: ` | ||
${nassimPersian} | ||
font-style: normal; | ||
font-weight: 700; | ||
${nassimPersian} | ||
${getFontStyleAndWeight('normal', 700)} | ||
`, | ||
@@ -84,0 +79,0 @@ }; |
@@ -57,1 +57,9 @@ import * as fonts from './font-families'; | ||
}; | ||
export const getSerifBold = service => { | ||
if (!fonts[service]) { | ||
return null; | ||
} | ||
const { serifBold } = fonts[service]; | ||
return serifBold || getSansBold(service); | ||
}; |
Sorry, the diff of this file is not supported yet
51265
763