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

feat: add data-ui5-compact-size attribute to root when compact is set #382

Merged
merged 1 commit into from
May 13, 2019
Merged
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
8 changes: 7 additions & 1 deletion packages/base/src/UI5Element.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getWCNoConflict } from "./Configuration.js";
import { getWCNoConflict, getCompactSize } from "./Configuration.js";
import DOMObserver from "./compatibility/DOMObserver.js";
import ShadowDOM from "./compatibility/ShadowDOM.js";
import UI5ElementMetadata from "./UI5ElementMetadata.js";
Expand Down Expand Up @@ -78,6 +78,12 @@ class UI5Element extends HTMLElement {
}

async _initializeShadowRoot() {
const isCompact = getCompactSize();

if (isCompact) {
this.setAttribute("data-ui5-compact-size", "");
}

if (this.constructor.getMetadata().getNoShadowDOM()) {
return Promise.resolve();
}
Expand Down