Skip to content

Commit ef9009f

Browse files
committed
feat: update Angular dependencies and improve split-button directive
- Removed peer dependencies for Angular core. - Updated Angular dependencies to version 21.1.1 for animations, CDK, common, compiler, compiler-cli, core, forms, material, platform-browser, platform-browser-dynamic, and router. - Enhanced documentation by removing unnecessary setup instructions and clarifying usage and theming sections. - Set default variant for split-button to 'filled' in PlaygroundComponent. - Refactored styles for split-button to be injected dynamically into the document head, simplifying usage. - Improved split-button directive to handle menu alignment and trigger positioning more effectively.
1 parent 6bde8c3 commit ef9009f

8 files changed

Lines changed: 395 additions & 401 deletions

File tree

README.md

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,7 @@ npm install @softwarity/split-button
5353

5454
## Usage
5555

56-
### 1. Include styles in your global stylesheet
57-
58-
In your `styles.scss`, import and include the split-button styles:
59-
60-
```scss
61-
@use '@softwarity/split-button/split-button-theme' as split-button;
62-
63-
// Include split-button base styles (required)
64-
@include split-button.styles();
65-
```
66-
67-
### 2. Import the directive in your component
56+
### 1. Import the directive in your component
6857

6958
```typescript
7059
import { SplitButtonDirective } from '@softwarity/split-button';
@@ -78,7 +67,7 @@ import { MatMenuModule } from '@angular/material/menu';
7867
export class MyComponent {}
7968
```
8069

81-
### 3. Add the `appSplitButton` directive to your button
70+
### 2. Add the `appSplitButton` directive to your button
8271

8372
```html
8473
<!-- Text button (default) -->
@@ -132,33 +121,21 @@ export class MyComponent {}
132121
| Outlined | Medium emphasis with a border outline |
133122
| Elevated | Medium emphasis with a shadow elevation |
134123

135-
## Theming (Material 3)
124+
## Theming (Optional)
136125

137-
The directive provides a SCSS mixin to customize the colors. This approach follows Angular Material's theming pattern.
138-
139-
### Setup
140-
141-
In your application's `styles.scss`, import the theme file and call the `overrides` mixin:
126+
The directive automatically injects its styles. If you want to customize the colors, you can use the optional SCSS mixin:
142127

143128
```scss
144-
@use '@angular/material' as mat;
145129
@use '@softwarity/split-button/split-button-theme' as split-button;
146130

147-
// Your Material 3 theme
148-
html {
149-
@include mat.theme((
150-
color: (
151-
primary: mat.$violet-palette,
152-
tertiary: mat.$yellow-palette
153-
)
154-
));
155-
156-
// Optional: customize split-button colors
157-
// @include split-button.overrides();
158-
}
131+
// Customize split-button colors
132+
@include split-button.overrides((
133+
filled-container-color: #ff5722,
134+
filled-label-color: #ffffff
135+
));
159136
```
160137

161-
### Customization
138+
### Available Tokens
162139

163140
The `overrides` mixin accepts a map of tokens to customize the appearance:
164141

0 commit comments

Comments
 (0)