Skip to content

Commit

Permalink
wip scss transform
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Kiefer committed Nov 7, 2023
1 parent 91202c4 commit 55cea38
Show file tree
Hide file tree
Showing 22 changed files with 2,016 additions and 21 deletions.
15 changes: 15 additions & 0 deletions e2e/carbon/carbon.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@use '@carbon/styles' as * with (
$font-path: 'https://fonts.camunda.io'
);
@use '@carbon/styles/scss/themes';
@use '@carbon/styles/scss/theme';

@import '@bpmn-io/form-js-carbon-styles/src/carbon-styles';

.cds--g10 {
@include theme.theme(themes.$g10);
}

.cds--g100 {
@include theme.theme(themes.$g100);
}
4 changes: 2 additions & 2 deletions e2e/carbon/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forms playground</title>
<title>Carbon styles</title>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap" rel="stylesheet">
<style>
Expand All @@ -16,7 +16,7 @@
}
</style>
</head>
<body class="cds--g10">
<body class="cds--g100">
<div id="container" role="main"></div>
<script type="module" src="index.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion e2e/carbon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '@bpmn-io/form-js/dist/assets/form-js.css';
import '@bpmn-io/form-js/dist/assets/form-js-editor.css';
import '@bpmn-io/form-js/dist/assets/form-js-playground.css';

import './theme.scss';
import './carbon.scss';

import { renderSchema } from '../renderSchema';

Expand Down
23 changes: 23 additions & 0 deletions e2e/theming/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Theming</title>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,600;1,400&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap" rel="stylesheet">
<style>
html, body, #container {
margin: 0;
padding: 0;
width: 100vw;
height: 100vh;
}
</style>
</head>
<body class="cds--g10">
<div id="container" role="main"></div>
<script type="module" src="index.js"></script>
</body>
</html>
9 changes: 9 additions & 0 deletions e2e/theming/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import '@bpmn-io/form-js/dist/assets/form-js.css';
import '@bpmn-io/form-js/dist/assets/form-js-editor.css';
import '@bpmn-io/form-js/dist/assets/form-js-playground.css';

import './theme.scss';

import { renderSchema } from '../renderSchema';

renderSchema();
File renamed without changes.
38 changes: 38 additions & 0 deletions e2e/visual/carbon-styles.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const { expect } = require('@playwright/test');

const { test } = require('../test-fixtures');

const schema = require('./fixtures/complex.json');

test('carbon styles', async ({ page, makeAxeBuilder }) => {

// given
await page.route('/form', route => {

route.fulfill({
status: 200,
body: JSON.stringify({
data: {
schema,
component: 'viewer'
}
})
});
});

// when
await page.goto('/carbon');

await page.waitForSelector('#container', {
state: 'visible'
});

// then
await expect(page).toHaveScreenshot();

// and then
const results = await makeAxeBuilder().analyze();

expect(results.violations).toHaveLength(0);
expect(results.passes.length).toBeGreaterThan(0);
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 55cea38

Please sign in to comment.