Skip to content

Commit 86a000b

Browse files
committed
Fix css variables and button.spec.ts
1 parent 47e840f commit 86a000b

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

src/pg/button/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ import PgButton from '@pictogrammers/components/pg/button';
3838
| `--pg-button-active-color` | `#fff` | `active` Text color |
3939
| `--pg-button-active-background-color` | `#453C4F` | `active` Background color |
4040
| `--pg-button-active-border-color` | `#453C4F` | `active` Border color |
41+
| `--pg-button-padding` | `0.25rem 0.5rem` | Padding. |
42+
| `--pg-button-font-size` | `1rem` | Font size. |
43+
| `--pg-button-line-height` | `1.5rem` | Line height. |
4144

4245
### Slots
4346

src/pg/button/button.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
align-items: center;
88
align-content: center;
99
font-family: var(--pg-font-family);
10-
font-size: 1rem;
11-
line-height: 1.5rem;
10+
font-size: var(--pg-button-font-size, 1rem);
11+
line-height: var(--pg-button-line-height, 1.5rem);
1212
border: 1px solid var(--pg-button-border-color, #453C4F);
1313
background-color: var(--pg-button-background-color, #fff);
1414
color: var(--pg-button-color, #453C4F);

src/pg/button/button.spec.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { selectComponent, getProps } from '@pictogrammers/element';
2+
3+
import './button';
4+
import PgButton from './button';
5+
6+
const PG_BUTTON = 'pg-button';
7+
8+
describe('pg-button', () => {
9+
10+
beforeEach(() => {
11+
var c = document.createElement(PG_BUTTON);
12+
document.body.appendChild(c);
13+
});
14+
15+
afterEach(() => {
16+
while (document.body.firstChild) {
17+
document.body.removeChild(document.body.firstChild);
18+
}
19+
});
20+
21+
it('should be registered', () => {
22+
expect(customElements.get(PG_BUTTON)).toBeDefined();
23+
});
24+
25+
it('should only expose known props', () => {
26+
const props = getProps(PG_BUTTON);
27+
expect(props.length).toBe(5);
28+
expect(props).toContain('active');
29+
expect(props).toContain('block');
30+
expect(props).toContain('start');
31+
expect(props).toContain('center');
32+
expect(props).toContain('end');
33+
});
34+
35+
});

0 commit comments

Comments
 (0)