Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carbon Styles: Sass style sheet #842

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading