Skip to content

Commit 1938448

Browse files
committed
Add css variables support
1 parent 424ee3f commit 1938448

4 files changed

Lines changed: 19 additions & 11 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
:root, :host {
2+
--ember-basic-dropdown-content-background-color: #fff;
3+
--ember-basic-dropdown-content-z-index: 1000;
4+
--ember-basic-dropdown-overlay-background: rgb(0 0 0 / 50%);
5+
--ember-basic-dropdown-overlay-pointer-events: none;
6+
}

docs/app/templates/public-pages/docs/styles.gts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@ import CodeExample from '../../../components/code-example';
66

77
<p>
88
Since this component doesn't any visual theme, you can apply styles to it
9-
just with plain CSS or even adding the classes your favourite CSS framework
9+
just with CSS variables, plain CSS or even adding the classes your favorite CSS framework
1010
gives you.
1111
</p>
1212

13-
<p>
14-
If don't use any css pre-processor this is all. If you do use SASS, the
15-
addon will know it and will have to
16-
<code>@use</code>
17-
the styles explicitly. This gives you the chance to set a few variables that
18-
Ember Basic Dropdown will use.
19-
</p>
13+
<CodeExample @css="styles-0.css" @showResult={{false}} @activeTab="css" />
2014

2115
<p>
22-
There is only four variables you can tweak (Sass syntax)
16+
If you use SASS you can override the default values by using the SASS syntax
2317
</p>
2418

2519
<CodeExample @scss="styles-1.scss" @showResult={{false}} @activeTab="scss" />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@use 'scss/variables.scss' with (
2+
$ember-basic-dropdown-content-background-color: var(--ember-basic-dropdown-content-background-color, #fff),
3+
$ember-basic-dropdown-content-z-index: var(--ember-basic-dropdown-content-z-index, 1000),
4+
$ember-basic-dropdown-overlay-background: var(--ember-basic-dropdown-overlay-background, rgba(0, 0, 0, 0.5)),
5+
$ember-basic-dropdown-overlay-pointer-events: var(--ember-basic-dropdown-overlay-pointer-events, none)
6+
);
7+
8+
@use "scss/base.scss";

rollup.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const tsConfig = resolve(rootDirectory, './tsconfig.publish.json');
1616

1717
export default [
1818
{
19-
input: './_index.scss',
19+
input: './ember-basic-dropdown-for-css-generate.scss',
2020
output: {
2121
file: './src/vendor/ember-basic-dropdown.js',
2222
assetFileNames: '[name][extname]',
@@ -29,7 +29,7 @@ export default [
2929
],
3030
},
3131
{
32-
input: './_index.scss',
32+
input: './ember-basic-dropdown-for-css-generate.scss',
3333
output: {
3434
file: './src/vendor/ember-basic-dropdown.js',
3535
assetFileNames: '[name][extname]',

0 commit comments

Comments
 (0)