Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

V9-0.0 beta.5 - fix circular reference #375

Merged
merged 8 commits into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ Future Todo List
- Deprecate modal and orderCard component styles in next major version as unused.


v9.0.0-beta.5
------------------------------
*June 21, 2022*

### Changed
- moved `$fozzie-breakpoints` out of variables file and into the breakpoints helper file to remove circular reference
- hardcoded the value of `$line-height-base` to be the default output of the `line-height` function it was previously calling (also to remove a circular reference)


v9.0.0-beta.4
------------------------------
*June 20, 2022*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@justeat/fozzie",
"title": "Fozzie – Just Eat UI Web Framework",
"description": "UI Web Framework for the Just Eat Global Platform",
"version": "9.0.0-beta.4",
"version": "9.0.0-beta.5",
"main": "dist/js/index.js",
"files": [
"dist/js",
Expand Down
4 changes: 3 additions & 1 deletion src/scss/settings/_include-media.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@use 'variables' as v;
@use '../tools/helpers/breakpoints';

@forward '../../../../../include-media/dist/_include-media' with (
$breakpoints: v.$fozzie-breakpoints,
$breakpoints: breakpoints.$fozzie-breakpoints,
$unit-intervals: v.$fozzie-unit-intervals
); // Cleaner media query declarations – http://include-media.com
12 changes: 1 addition & 11 deletions src/scss/settings/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@use '~@justeat/pie-design-tokens/dist/jet' as dt;
@use '../tools/functions/px-to-em';

/* stylelint-disable indentation */
// =================================
Expand Down Expand Up @@ -57,7 +56,7 @@ $type: (
) !default;

$font-weight-headings : dt.$font-weight-extrabold;
$line-height-base : line-height();
jamieomaguire marked this conversation as resolved.
Show resolved Hide resolved
$line-height-base : 1.43; // temporary workaround. This is the default output of units.line-height()

// Font stacks
$font-family-base : dt.$font-family-primary, dt.$font-family-secondary, sans-serif;
Expand All @@ -74,15 +73,6 @@ $fozzie-unit-intervals: (
'': 0
);

$fozzie-breakpoints: px-to-em.map-to-em((
tiny : 375px,
narrow : 414px, // narrow devices
narrowMid : 600px, // narrow-mid tweakpoint
mid : 768px, // mid bp
wide : 1025px, // wide bp
huge : 1280px // huge bp
), 16); // set to 16 as this is default browser size

// Layout setup
// ==========================================================================

Expand Down
4 changes: 2 additions & 2 deletions src/scss/tools/functions/_units.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
@function line-height($font-size: 'body-s', $line-height: '20', $scale: 'default') {
@if type-of($font-size) == 'number' {
@return decimal-round(math.div($line-height, $font-size), 2);
} @else if map-has-key($type, $font-size) { // else try and find the value in our type map
$key-map: map-get($type, $font-size);
} @else if map-has-key(v.$type, $font-size) { // else try and find the value in our type map
$key-map: map-get(v.$type, $font-size);
$font-list: map-get($key-map, $scale);

@if type-of($font-list) == 'list' {
Expand Down
12 changes: 11 additions & 1 deletion src/scss/tools/helpers/_breakpoints.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
@use '../../settings/variables' as v;
@use '../functions/units';
@use '../functions/px-to-em';

$fozzie-breakpoints: px-to-em.map-to-em((
tiny : 375px,
narrow : 414px, // narrow devices
narrowMid : 600px, // narrow-mid tweakpoint
mid : 768px, // mid bp
wide : 1025px, // wide bp
huge : 1280px // huge bp
), 16); // set to 16 as this is default browser size

@function populate-breakpoints() {
$breakpointString: '';
$breakpointsPx: units.map-to-px(v.$fozzie-breakpoints, 16);
$breakpointsPx: units.map-to-px($fozzie-breakpoints, 16);

@each $name, $value in $breakpointsPx {
$breakpointString: $breakpointString + '#{$name}:#{$value},';
Expand Down