Skip to content

Commit

Permalink
Removing text-align: justify via stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltan-dulac committed Nov 5, 2024
1 parent f1e292e commit b34993f
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 90 deletions.
55 changes: 55 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
"customSyntax": "postcss-less",
"extends": [ "stylelint-config-standard"],
"ignoreFiles": [
"**/*.js",
"enable-node-libs/**/*.css",
"js/out/**/*.css",
"js/enable-libs/**/*.css"
],
"plugins": ["@double-great/stylelint-a11y"],
"rules": {
"a11y/no-text-align-justify": true,
"alpha-value-notation": null,
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"color-function-notation": null,
"color-hex-length": null,
"comment-empty-line-before": null,
"comment-whitespace-inside": null,
"custom-property-empty-line-before": null,
"custom-property-pattern": null,
"declaration-empty-line-before": null,
"declaration-block-no-duplicate-properties": null,
"declaration-block-no-redundant-longhand-properties": null,
"declaration-block-no-shorthand-property-overrides": null,
"declaration-block-single-line-max-declarations": null,
"font-family-name-quotes": null,
"font-family-no-missing-generic-family-keyword": null,
"function-calc-no-unspaced-operator": null,
"function-name-case": null,
"function-no-unknown": null,
"function-url-quotes": null,
"hue-degree-notation": null,
"import-notation": null,
"keyframes-name-pattern": null,
"length-zero-no-unit": null,
"media-feature-range-notation": null,
"media-query-no-invalid": null,
"no-empty-source": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"number-max-precision": null,
"property-no-unknown": null,
"property-no-vendor-prefix": null,
"rule-empty-line-before": null,
"selector-class-pattern": null,
"selector-id-pattern": null,
"selector-no-vendor-prefix": null,
"selector-pseudo-element-colon-notation": null,
"shorthand-property-no-redundant-values": null,
"string-no-newline": null,
"value-keyword-case": null,
"value-no-vendor-prefix": null
}
}
2 changes: 2 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"js/out/**/*.css",
"js/enable-libs/**/*.css"
],
"plugins": ["@double-great/stylelint-a11y"],
"rules": {
"a11y/no-text-align-justify": true,
"alpha-value-notation": null,
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
Expand Down
8 changes: 0 additions & 8 deletions css/heading.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/range.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions less/heading.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ div.heading-example {
div.heading-example p {
font-size: (16/@px);
line-height: 1.4;
text-align: justify;
}

div.heading-example p:nth-of-type(2) {
Expand Down Expand Up @@ -52,13 +51,6 @@ div.heading-example p:nth-of-type(4) {
@h6-size: (18/@px);
@h7-size: (18/@px);

@line-height1: 36px;
@line-height2: 33px;
@line-height3: 30px;
@line-height4: 25px;
@line-height5: 22px;
@line-height6: 18px;
@line-height7: 18px;

div.heading-example {
h1,
Expand All @@ -67,7 +59,6 @@ div.heading-example {
font-weight: normal;
font-family: "Ultra", sans-serif;
font-size: @h1-size;
line-height: 42 * (36 / @line-height1);
text-transform: uppercase;
text-shadow:
0 2px white,
Expand All @@ -86,13 +77,11 @@ div.heading-example {
h2,
[role="heading"][aria-level="2"] {
font-size: @h2-size;
line-height: 40 * (30 / @line-height2);
}

h5,
[role="heading"][aria-level="5"] {
font-size: @h5-size;
line-height: 40 * (30 / @h5-size);
}

h3,
Expand All @@ -110,13 +99,11 @@ div.heading-example {
h3,
[role="heading"][aria-level="3"] {
font-size: @h3-size;
line-height: 40 * (22 / @h3-size);
}

h6,
[role="heading"][aria-level="6"] {
font-size: @h6-size;
line-height: 40 * (22 / @h6-size);
}

h4,
Expand All @@ -129,12 +116,10 @@ div.heading-example {
h4,
[role="heading"][aria-level="4"] {
font-size: @h4-size;
line-height: 20 * (18 / @h4-size);
}

[role="heading"][aria-level="7"] {
font-size: @h7-size;
line-height: 20 * (18 / @h7-size);
}

h1, h2, h3, h4, h5, h6, [role="heading"] {
Expand Down
2 changes: 1 addition & 1 deletion less/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ a {
width: 100%;

p {
text-align: justify;
text-align: center;
a {
color: @orange;
}
Expand Down
4 changes: 2 additions & 2 deletions less/range.less
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@
position: relative;
top: 50%;
line-height: 0;
text-align: justify;
text-align: center;
width: 100%;
pointer-events: none;
margin: 0 auto;
z-index: 5;

// trick so "justify" will work

&::after {
content: "";
width: 100%;
Expand Down
Loading

0 comments on commit b34993f

Please sign in to comment.