Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HeadingComponent]: Adjust encapsulation and CSS grid-column logic #344

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
width: 100%;
}

> fudis-heading {
grid-column: 1/-1;
}

&__margin {
&__top {
&__none {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
Component,
Input,
ViewEncapsulation,
ChangeDetectionStrategy,
OnInit,
OnChanges,
ElementRef,
} from '@angular/core';
import { FudisHeadingLevel, FudisHeadingSize } from '../../../types/typography';
import { FudisIdService } from '../../../services/id/id.service';
Expand All @@ -14,11 +14,18 @@ import { FudisSpacing, FudisTextAlign } from '../../../types/miscellaneous';
selector: 'fudis-heading',
templateUrl: './heading.component.html',
styleUrls: ['./heading.component.scss'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class HeadingComponent implements OnInit, OnChanges {
constructor(private _idService: FudisIdService) {}
constructor(
private _idService: FudisIdService,
private _headingElement: ElementRef,
) {
/**
* Set Heading wrapper to be "full width" if used inside Grid
*/
(_headingElement.nativeElement as HTMLHeadingElement).style.gridColumn = '1/-1';
}

/**
* Semantic level of heading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class LinkDirective extends LinkApiDirective implements OnInit, OnChanges
}

/**
* CSS classes for link element
* Additional CSS classes for the Link anchor element
*/
@Input() classes: string[] = [];

Expand Down
2 changes: 0 additions & 2 deletions ngx-fudis/projects/ngx-fudis/src/lib/utilities/storybook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const excludeEverythingExceptRegex = (array?: string[]): RegExp => {
export const excludeAllRegex: RegExp = /.*/;

const buttonCommonExclude: string[] = [
'classes',
'dropdownMenuId',
'dropdownOpen',
'buttonEl',
Expand Down Expand Up @@ -91,7 +90,6 @@ export const linkExclude: RegExp = excludeRegex([
'handleBlur',
'handleFocus',
'link',
'classes',
]);

export const notificationExclude: RegExp = excludeRegex(['link']);
Expand Down
Loading