Skip to content

Commit f1df213

Browse files
authored
Add css variables support (#1053)
* Add css variables support * Fix lint
1 parent 424ee3f commit f1df213

File tree

4 files changed

+33
-12
lines changed

4 files changed

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

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

Lines changed: 4 additions & 10 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
10-
gives you.
9+
just with CSS variables, plain CSS or even adding the classes your favorite
10+
CSS framework 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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@use "scss/variables.scss" with (
2+
$ember-basic-dropdown-content-background-color: var(
3+
--ember-basic-dropdown-content-background-color,
4+
#fff
5+
),
6+
$ember-basic-dropdown-content-z-index: var(
7+
--ember-basic-dropdown-content-z-index,
8+
1000
9+
),
10+
$ember-basic-dropdown-overlay-background: var(
11+
--ember-basic-dropdown-overlay-background,
12+
rgba(0, 0, 0, 0.5)
13+
),
14+
$ember-basic-dropdown-overlay-pointer-events: var(
15+
--ember-basic-dropdown-overlay-pointer-events,
16+
none
17+
)
18+
);
19+
20+
@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)