Skip to content

Commit

Permalink
feat: Add V9 Theme (#7757)
Browse files Browse the repository at this point in the history
* feat: Add V9 Theme
---------

Signed-off-by: Viraj Sanghvi <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
1 parent b46a34d commit 9d3ca79
Show file tree
Hide file tree
Showing 67 changed files with 3,685 additions and 19 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7757.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
feat:
- Add v9 theme (preview) ([#7757](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7757))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$globalStyleConstant: 14;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$globalStyleConstant: 15;
8 changes: 6 additions & 2 deletions packages/osd-optimizer/src/common/theme_tags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ it('returns default tags when passed undefined', () => {
"v7light",
"v8dark",
"v8light",
"v9dark",
"v9light",
]
`);
});
Expand All @@ -48,6 +50,8 @@ it('returns all tags when passed *', () => {
"v7light",
"v8dark",
"v8light",
"v9dark",
"v9light",
]
`);
});
Expand Down Expand Up @@ -81,13 +85,13 @@ it('returns specific tags when passed an array', () => {

it('throws when an invalid tag is in the array', () => {
expect(() => parseThemeTags(['v8light', 'v7light', 'bar'])).toThrowErrorMatchingInlineSnapshot(
`"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light]"`
`"Invalid theme tags [bar], options: [v7dark, v7light, v8dark, v8light, v9dark, v9light]"`
);
});

it('throws when an invalid tags in comma separated list', () => {
expect(() => parseThemeTags('v8light ,v7light,bar,box ')).toThrowErrorMatchingInlineSnapshot(
`"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light]"`
`"Invalid theme tags [bar, box], options: [v7dark, v7light, v8dark, v8light, v9dark, v9light]"`
);
});

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
bar.cache.refresh();
expect(bar.cache.getModuleCount()).toBe(
// code + styles + style/css-loader runtimes + public path updater
25
33
);

expect(bar.cache.getReferencedFiles()?.map(absolutePathSerializer.serialize).sort())
Expand All @@ -195,6 +195,8 @@ it('builds expected bundles, saves bundle counts to metadata', async () => {
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7light.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8dark.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v8light.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v9dark.scss",
"<absolute path>/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v9light.scss",
"<absolute path>/packages/osd-optimizer/target/worker/entry_point_creator.js",
"<absolute path>/packages/osd-ui-shared-deps/public_path_module_creator.js",
]
Expand Down
2 changes: 2 additions & 0 deletions packages/osd-optimizer/src/optimizer/cache_keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ describe('getOptimizerCacheKey()', () => {
"v7light",
"v8dark",
"v8light",
"v9dark",
"v9light",
],
},
}
Expand Down
2 changes: 2 additions & 0 deletions packages/osd-ui-framework/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ module.exports = function (grunt) {
uiFrameworkCompile('src/kui_dark.scss', 'dist/kui_dark.css'),
uiFrameworkCompile('src/kui_next_light.scss', 'dist/kui_next_light.css'),
uiFrameworkCompile('src/kui_next_dark.scss', 'dist/kui_next_dark.css'),
uiFrameworkCompile('src/kui_v9_light.scss', 'dist/kui_v9_light.css'),
uiFrameworkCompile('src/kui_v9_dark.scss', 'dist/kui_v9_dark.css'),
]).then(done);
});
};
Loading

0 comments on commit 9d3ca79

Please sign in to comment.