Skip to content
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
7 changes: 7 additions & 0 deletions .changeset/violet-chicken-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lynx-js/web-style-transformer": patch
"@lynx-js/web-elements": patch
"@lynx-js/web-core": patch
---

fix: --lynx-color will be removed, and if color contains `gradient` it will be processed as transparent.
8 changes: 6 additions & 2 deletions packages/web-platform/web-elements/src/XText/x-text.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ x-text {
display: flex;
overflow-wrap: break-word;
align-items: stretch;
color: var(--lynx-color);
background-image: var(--lynx-text-bg-color);
color: initial;
}

x-text > x-text, x-text > lynx-wrapper > x-text {
color: inherit;
}

x-text:not(x-text > x-text):not(x-text > lynx-wrapper > x-text) {
--lynx-color: canvastext;
--lynx-text-bg-color: initial;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,8 @@ const renameRules: {
},
],
'color': [
'color',
{
name: '--lynx-color',
name: 'color',
valueProcessor(value) {
return value.includes('gradient')
? 'transparent'
Expand Down
6 changes: 6 additions & 0 deletions packages/web-platform/web-tests/tests/react.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright 2024 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -103,7 +103,7 @@
await target.click();
await expect(await target.getAttribute('style')).toContain('green');
await target.click();
await expect(await target.getAttribute('style')).toContain('pink');

Check failure on line 106 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (Default) / check

[webkit] › tests/react.spec.ts:99:5 › reactlynx3 tests › basic › basic-event-target-id

2) [webkit] › tests/react.spec.ts:99:5 › reactlynx3 tests › basic › basic-event-target-id ──────── Error: expect(received).toContain(expected) // indexOf Expected substring: "pink" Received string: "height:100px;width:100px;background:green;" 104 | await expect(await target.getAttribute('style')).toContain('green'); 105 | await target.click(); > 106 | await expect(await target.getAttribute('style')).toContain('pink'); | ^ 107 | }); 108 | test('basic-class-selector', async ({ page }, { title }) => { 109 | await goto(page, title); at /home/runner/_work/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:106:56
});
test('basic-class-selector', async ({ page }, { title }) => {
await goto(page, title);
Expand Down Expand Up @@ -369,7 +369,7 @@
await goto(page, title);
await wait(100);
const target = page.locator('#target');
await target.click();

Check failure on line 372 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (Default) / check

[webkit] › tests/react.spec.ts:366:5 › reactlynx3 tests › basic › basic-mts-run-on-main-thread

3) [webkit] › tests/react.spec.ts:366:5 › reactlynx3 tests › basic › basic-mts-run-on-main-thread Error: locator.click: Test timeout of 30000ms exceeded. Call log: - waiting for locator('#target') - locator resolved to <x-view l-uid="2" id="target" lynx-tag="view" l-p-comp-uid="1" has-react-ref="true"></x-view> - attempting click action 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <iframe src="about:blank" id="webpack-dev-server-client-overlay"></iframe> intercepts pointer events - retrying click action - waiting 20ms 2 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <iframe src="about:blank" id="webpack-dev-server-client-overlay"></iframe> intercepts pointer events - retrying click action - waiting 100ms 50 × waiting for element to be visible, enabled and stable - element is visible, enabled and stable - scrolling into view if needed - done scrolling - <iframe src="about:blank" id="webpack-dev-server-client-overlay"></iframe> intercepts pointer events - retrying click action - waiting 500ms 370 | await wait(100); 371 | const target = page.locator('#target'); > 372 | await target.click(); | ^ 373 | await expect(target).toHaveCSS('background-color', 'rgb(0, 128, 0)'); // green 374 | }, 375 | ); at /home/runner/_work/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:372:22
await expect(target).toHaveCSS('background-color', 'rgb(0, 128, 0)'); // green
},
);
Expand Down Expand Up @@ -631,7 +631,7 @@
document.querySelector('lynx-view')!.remove();
});
await wait(50);
expect(message).toContain('fin');

Check failure on line 634 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (Default) / check

[chromium] › tests/react.spec.ts:622:5 › reactlynx3 tests › apis › api-dispose

7) [chromium] › tests/react.spec.ts:622:5 › reactlynx3 tests › apis › api-dispose ──────────────── Error: expect(received).toContain(expected) // indexOf Expected value: "fin" Received array: ["NYI: profileStart. This is an issue of lynx-core.", "NYI: profileEnd. This is an issue of lynx-core."] 632 | }); 633 | await wait(50); > 634 | expect(message).toContain('fin'); | ^ 635 | expect(page.workers().length).toStrictEqual(1); 636 | }); 637 | at /home/runner/_work/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:634:23
expect(page.workers().length).toStrictEqual(1);
});

Expand Down Expand Up @@ -1245,9 +1245,9 @@
await wait(100);
const target = page.locator('#target');
await target.click();
await expect(await target.getAttribute('style')).toContain('green');

Check failure on line 1248 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (Default) / check

[webkit] › tests/react.spec.ts:1243:5 › reactlynx3 tests › configs › config-mode-dev-with-all-in-one

4) [webkit] › tests/react.spec.ts:1243:5 › reactlynx3 tests › configs › config-mode-dev-with-all-in-one Error: expect(received).toContain(expected) // indexOf Expected substring: "green" Received string: "height:100px;width:100px;background:pink;" 1246 | const target = page.locator('#target'); 1247 | await target.click(); > 1248 | await expect(await target.getAttribute('style')).toContain('green'); | ^ 1249 | await target.click(); 1250 | await expect(await target.getAttribute('style')).toContain('pink'); 1251 | }); at /home/runner/_work/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1248:56
await target.click();
await expect(await target.getAttribute('style')).toContain('pink');

Check failure on line 1250 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (Default) / check

[webkit] › tests/react.spec.ts:1243:5 › reactlynx3 tests › configs › config-mode-dev-with-all-in-one

4) [webkit] › tests/react.spec.ts:1243:5 › reactlynx3 tests › configs › config-mode-dev-with-all-in-one Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toContain(expected) // indexOf Expected substring: "pink" Received string: "height:100px;width:100px;background:green;" 1248 | await expect(await target.getAttribute('style')).toContain('green'); 1249 | await target.click(); > 1250 | await expect(await target.getAttribute('style')).toContain('pink'); | ^ 1251 | }); 1252 | 1253 | test( at /home/runner/_work/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:1250:56
});

test(
Expand Down Expand Up @@ -1586,6 +1586,12 @@
await goto(page, title);
await diffScreenShot(page, 'text', 'word-break');
});

test('basic-element-text-color', async ({ page }, { title }) => {
await goto(page, title);
await wait(100);
await diffScreenShot(page, 'text', 'basic-element-text-color');
});
});
test.describe('image', () => {
test('basic-element-image-src', async ({ page }, { title }) => {
Expand Down Expand Up @@ -2285,7 +2291,7 @@
inputDom?.setSelectionRange(2, 5);
});
const result = await page.locator('.result').first().innerText();
expect(result).toBe('2-5');

Check failure on line 2294 in packages/web-platform/web-tests/tests/react.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright (Default) / check

[chromium] › tests/react.spec.ts:2282:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindselection

8) [chromium] › tests/react.spec.ts:2282:7 › reactlynx3 tests › elements › x-input › basic-element-x-input-bindselection Error: expect(received).toBe(expected) // Object.is equality Expected: "2-5" Received: "" 2292 | }); 2293 | const result = await page.locator('.result').first().innerText(); > 2294 | expect(result).toBe('2-5'); | ^ 2295 | }, 2296 | ); 2297 | test( at /home/runner/_work/lynx-stack/lynx-stack/packages/web-platform/web-tests/tests/react.spec.ts:2294:26
},
);
test(
Expand Down
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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.a {
font-size: 16px;
color: red;
}

.b {
font-size: 80px;
color: linear-gradient(green, yellow);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2023 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { root } from '@lynx-js/react';
import './index.css';

function App() {
return (
<view>
<text class='a b'>
hello lynx
</text>
</view>
);
}
root.render(<App></App>);
Loading