-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1369 from City-of-Helsinki/hds-2393-core-scss-v4-…
…for-breadcrumbs Hds 2393 core scss v4 for breadcrumbs
- Loading branch information
Showing
32 changed files
with
294 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { test } from '@playwright/test'; | ||
import { takeAllStorySnapshots } from '../../../helpers'; | ||
|
||
const componentName = 'breadcrumb'; | ||
const storybook = 'core'; | ||
const takeStateSnapshots = true; | ||
|
||
test.describe(`Testing ${storybook} component "${componentName}"`, () => { | ||
test('Take snapshots of all stories', async ({ page, isMobile }) => { | ||
await takeAllStorySnapshots({ page, isMobile, takeStateSnapshots, storybook, componentName }); | ||
}); | ||
}); |
Binary file added
BIN
+5.53 KB
...breadcrumb-spec.ts-snapshots/core-components-breadcrumb--breadcrumb-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.94 KB
...-breadcrumb-spec.ts-snapshots/core-components-breadcrumb--breadcrumb-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.52 KB
...umb-spec.ts-snapshots/core-components-breadcrumb--with-custom-theme-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.94 KB
...rumb-spec.ts-snapshots/core-components-breadcrumb--with-custom-theme-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { test } from '@playwright/test'; | ||
import { takeAllStorySnapshots } from '../../../helpers'; | ||
|
||
const componentName = 'breadcrumb'; | ||
const storybook = 'react'; | ||
const takeStateSnapshots = true; | ||
|
||
test.describe(`Testing ${storybook} component "${componentName}"`, () => { | ||
test('Take snapshots of all stories', async ({ page, isMobile }) => { | ||
await takeAllStorySnapshots({ page, isMobile, takeStateSnapshots, storybook, componentName }); | ||
}); | ||
}); |
Binary file added
BIN
+5.26 KB
...t-breadcrumb-spec.ts-snapshots/react-components-breadcrumb--example-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.6 KB
...mb-spec.ts-snapshots/react-components-breadcrumb--example-in-header-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.91 KB
...umb-spec.ts-snapshots/react-components-breadcrumb--example-in-header-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.82 KB
...ct-breadcrumb-spec.ts-snapshots/react-components-breadcrumb--example-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.3 KB
...mb-spec.ts-snapshots/react-components-breadcrumb--last-item-is-link-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.12 KB
...umb-spec.ts-snapshots/react-components-breadcrumb--last-item-is-link-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.25 KB
...mb-spec.ts-snapshots/react-components-breadcrumb--with-custom-theme-desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.82 KB
...umb-spec.ts-snapshots/react-components-breadcrumb--with-custom-theme-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
packages/core/src/components/breadcrumb/_breadcrumb-mixin.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
@use '../../utils/bem' as BemUtil; | ||
|
||
@mixin base { | ||
--horizontal-margin-small: var(--spacing-layout-2-xs); | ||
--horizontal-margin-medium: var(--spacing-layout-xs); | ||
--horizontal-margin-large: var(--spacing-layout-xs); | ||
--horizontal-margin-x-large: var(--spacing-layout-s); | ||
--horizontal-margin: var(--horizontal-margin-small); | ||
|
||
display: flex; | ||
margin: 0 var(--horizontal-margin); | ||
padding: var(--spacing-s) 0; | ||
|
||
&__list { | ||
align-items: center; | ||
flex-direction: row; | ||
word-wrap: break-word; | ||
|
||
&-item { | ||
align-items: center; | ||
display: flex; | ||
line-height: var(--lineheight-l); | ||
} | ||
} | ||
|
||
&__link#{&}__link { | ||
--link-visited-color: none; | ||
--link-color: var(--color-black-90); | ||
} | ||
|
||
&__link { | ||
&:hover, | ||
&:focus { | ||
-webkit-text-decoration-color: var(--color-black-90); | ||
text-decoration-color: var(--color-black-90); | ||
} | ||
} | ||
|
||
&__back-arrow#{&}__back-arrow { | ||
display: inline-flex; | ||
|
||
/* compensate the white space in the icon */ | ||
margin-left: -5px; | ||
margin-right: -3px; | ||
|
||
--icon-size: var(--spacing-m); | ||
} | ||
|
||
&__separator#{&}__separator { | ||
display: inline-flex; | ||
padding-left: var(--spacing-3-xs); | ||
|
||
--icon-size: var(--spacing-s); | ||
} | ||
|
||
@media (min-width: 768px) { | ||
--horizontal-margin: var(--horizontal-margin-medium); | ||
} | ||
|
||
@media (min-width: 992px) { | ||
--horizontal-margin: var(--horizontal-margin-large); | ||
} | ||
|
||
@media (min-width: 1248px) { | ||
--horizontal-margin: var(--horizontal-margin-x-large); | ||
} | ||
} | ||
|
||
@mixin active { | ||
&__list { | ||
&-item { | ||
&--active { | ||
font-weight: 700; | ||
|
||
/* to match 3px border around links */ | ||
padding: 3px; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin mobile { | ||
&__list { | ||
&--mobile { | ||
display: flex; | ||
|
||
#{BemUtil.get-block(&)}__link { | ||
font-size: var(--fontsize-body-l); | ||
} | ||
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
&__list { | ||
&--mobile { | ||
display: none; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin desktop { | ||
&__list { | ||
&--desktop { | ||
display: none; | ||
} | ||
} | ||
|
||
@media (min-width: 768px) { | ||
&__list { | ||
&--desktop { | ||
display: flex; | ||
flex-wrap: wrap; | ||
list-style: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin breadcrumb( | ||
$all: true, | ||
$base: false, | ||
$active: false, | ||
$mobile: false, | ||
$desktop: false, | ||
$override: null, | ||
$react: false | ||
) { | ||
$className: 'breadcrumb'; | ||
|
||
@if $override { | ||
$className: $override; | ||
} | ||
|
||
@if $all or $base { | ||
@include BemUtil.block($className, if($override, true, false), $react) { | ||
@include base; | ||
} | ||
} | ||
|
||
@if $all or $active { | ||
@include BemUtil.block($className, if($override, true, false), $react) { | ||
@include active; | ||
} | ||
} | ||
|
||
@if $all or $mobile { | ||
@include BemUtil.block($className, if($override, true, false), $react) { | ||
@include mobile; | ||
} | ||
} | ||
|
||
@if $all or $desktop { | ||
@include BemUtil.block($className, if($override, true, false), $react) { | ||
@include desktop; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@use './breadcrumb-mixin' as *; | ||
@include breadcrumb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-23.3 KB
...t/.loki/reference/chrome_iphone7_Components_Breadcrumb_Breadcrumb_in_header.png
Binary file not shown.
Binary file removed
BIN
-4.65 KB
packages/react/.loki/reference/chrome_iphone7_Components_Breadcrumb_Example.png
Binary file not shown.
Binary file removed
BIN
-5.63 KB
...react/.loki/reference/chrome_iphone7_Components_Breadcrumb_Last_item_a_link.png
Binary file not shown.
Binary file removed
BIN
-4.62 KB
...eact/.loki/reference/chrome_iphone7_Components_Breadcrumb_With_custom_theme.png
Binary file not shown.
Binary file removed
BIN
-21.4 KB
...ct/.loki/reference/chrome_laptop_Components_Breadcrumb_Breadcrumb_in_header.png
Binary file not shown.
Binary file removed
BIN
-5.93 KB
packages/react/.loki/reference/chrome_laptop_Components_Breadcrumb_Example.png
Binary file not shown.
Binary file removed
BIN
-4.89 KB
.../react/.loki/reference/chrome_laptop_Components_Breadcrumb_Last_item_a_link.png
Binary file not shown.
Binary file removed
BIN
-5.9 KB
...react/.loki/reference/chrome_laptop_Components_Breadcrumb_With_custom_theme.png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/react/src/components/breadcrumb/Breadcrumb.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.