UNPKG

@yuebai008/cli

Version:

Command line interface for rapid qg-minigame development

1 lines 2.07 kB
import*as i18n from"../../core/i18n/i18n.js";const UIStrings={topAppliedToAStatically:"`Top` applied to a statically positioned element",leftAppliedToAStatically:"`Left` applied to a statically positioned element",rightAppliedToAStatically:"`Right` applied to a statically positioned element",bottomAppliedToAStatically:"`Bottom` applied to a statically positioned element",widthAppliedToAnInlineElement:"`Width` applied to an inline element",heightAppliedToAnInlineElement:"`Height` applied to an inline element",verticalAlignmentAppliedTo:"Vertical alignment applied to element which is neither `inline` nor `table-cell`"},str_=i18n.i18n.registerUIStrings("panels/css_overview/CSSOverviewUnusedDeclarations.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export class CSSOverviewUnusedDeclarations{static add(t,i,e){const n=t.get(i)||[];n.push(e),t.set(i,n)}static checkForUnusedPositionValues(t,i,e,n,l,a,o,d){if("static"===e[n]){if("auto"!==e[l]){const n=i18nString(UIStrings.topAppliedToAStatically);this.add(t,n,{declaration:`top: ${e[l]}`,nodeId:i})}if("auto"!==e[a]){const n=i18nString(UIStrings.leftAppliedToAStatically);this.add(t,n,{declaration:`left: ${e[a]}`,nodeId:i})}if("auto"!==e[o]){const n=i18nString(UIStrings.rightAppliedToAStatically);this.add(t,n,{declaration:`right: ${e[o]}`,nodeId:i})}if("auto"!==e[d]){const n=i18nString(UIStrings.bottomAppliedToAStatically);this.add(t,n,{declaration:`bottom: ${e[d]}`,nodeId:i})}}}static checkForUnusedWidthAndHeightValues(t,i,e,n,l,a){if("inline"===e[n]){if("auto"!==e[l]){const n=i18nString(UIStrings.widthAppliedToAnInlineElement);this.add(t,n,{declaration:`width: ${e[l]}`,nodeId:i})}if("auto"!==e[a]){const n=i18nString(UIStrings.heightAppliedToAnInlineElement);this.add(t,n,{declaration:`height: ${e[a]}`,nodeId:i})}}}static checkForInvalidVerticalAlignment(t,i,e,n,l){if(e[n]&&!e[n].startsWith("inline")&&!e[n].startsWith("table")&&"baseline"!==e[l]){const n=i18nString(UIStrings.verticalAlignmentAppliedTo);this.add(t,n,{declaration:`vertical-align: ${e[l]}`,nodeId:i})}}}