Skip to content

Commit 349f9c5

Browse files
chore(lint): DLT-2723 pre-commit autofix css logical properties (#1041)
1 parent 1e56947 commit 349f9c5

File tree

31 files changed

+367
-89
lines changed

31 files changed

+367
-89
lines changed

.lintstagedrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
const path = require('path');
2+
3+
const fixLogicalProperties = path.resolve(__dirname, 'packages/stylelint-plugin-dialtone/bin/fix-logical-properties.js');
4+
15
module.exports = {
26
'*.{js,mjs,cjs}': [
37
'eslint --fix',
48
],
59
'*.json': [
610
'eslint --fix',
711
],
12+
'*.{less,css}': [
13+
`node ${fixLogicalProperties}`,
14+
],
15+
'*.{vue,md,html}': [
16+
`node ${fixLogicalProperties}`,
17+
],
818
};

apps/dialtone-documentation/docs/.vuepress/baseComponents/BlogPost.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const blogLink = computed(() => {
8686
<style lang="less">
8787
.blog-post-content {
8888
.d-docsite--header-2:first-of-type {
89-
margin-top: var(--dt-size-500);
89+
margin-block-start: var(--dt-size-500);
9090
}
9191
}
9292
</style>

apps/dialtone-documentation/docs/.vuepress/baseComponents/CodeExampleTabs.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,11 @@ const formatHTML = async (elementHTML) => {
200200
201201
<style scoped lang="less">
202202
.code-example-tab-group {
203-
margin-top: var(--dt-size-500);
203+
margin-block-start: var(--dt-size-500);
204204
position: relative;
205205
206206
.language-html {
207-
margin-top: 0;
207+
margin-block-start: 0;
208208
position: relative;
209209
}
210210

apps/dialtone-documentation/docs/.vuepress/baseComponents/ShowcaseCarousel.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ onMounted(() => {
160160
<style scoped>
161161
.showcase-carousel {
162162
overflow: hidden;
163-
width: 100%;
164-
max-width: 100vw;
163+
inline-size: 100%;
164+
max-inline-size: 100vw;
165165
}
166166
167167
.showcase-carousel__track {
168168
will-change: transform;
169169
transition: none;
170-
height: 732px;
170+
block-size: 732px;
171171
}
172172
</style>

apps/dialtone-documentation/docs/.vuepress/baseComponents/tokens/TokenTable.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export default {
195195
<style scoped>
196196
.token-name {
197197
/* make space for the copy button that appears on mouse enter */
198-
min-height: 2.8rem;
198+
min-block-size: 2.8rem;
199199
}
200200
201201
.d-table th {
@@ -204,7 +204,7 @@ export default {
204204
}
205205
206206
.d-table tr th:first-child {
207-
width: 16rem;
207+
inline-size: 16rem;
208208
}
209209
210210
.d-table thead tr {

apps/dialtone-documentation/docs/.vuepress/theme/assets/less/dialtone-docs.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ html body {
298298

299299
position: fixed;
300300
z-index: 1;
301-
max-width: calc(var(--dt-size-300) * 350);
301+
max-inline-size: calc(var(--dt-size-300) * 350);
302302
border-radius: var(--dt-size-radius-450);
303303
/* stylelint-disable-next-line meowtec/no-px */
304304
box-shadow: 0 255.043px 71.487px 0 rgba(0, 0, 0, 0.00), 0 163.131px 65.306px 0 rgba(0, 0, 0, 0.01), 0 91.912px 55.094px 0 rgba(0, 0, 0, 0.03), 0 40.85px 40.85px 0 rgba(0, 0, 0, 0.05), 0 10.212px 22.306px 0 rgba(0, 0, 0, 0.05);
@@ -354,7 +354,7 @@ html body {
354354
border-block: var(--dt-size-border-100) solid var(--dt-color-border-subtle);
355355

356356
@media (min-width: 980px) {
357-
margin-bottom: var(--dt-size-500);
357+
margin-block-end: var(--dt-size-500);
358358
border: var(--dt-size-border-100) solid var(--dt-color-border-subtle);
359359
border-radius: var(--dt-size-radius-500);
360360
margin-inline: var(--dt-size-500);

apps/dialtone-documentation/docs/.vuepress/theme/components/PageToc.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ function isItemActive (item) {
7878

7979
<style lang="less" scoped>
8080
.dialtone-toc {
81-
width: var(--dt-size-850);
82-
height: calc(100vh - var(--dt-size-700));
83-
top: var(--dt-size-700);
81+
inline-size: var(--dt-size-850);
82+
block-size: calc(100vh - var(--dt-size-700));
83+
inset-block-start: var(--dt-size-700);
8484
}
8585
</style>

apps/dialtone-documentation/docs/.vuepress/theme/components/SidebarItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,6 @@ function handleClick (event, listeners, navigate, link) {
297297
298298
<style lang="less" scoped>
299299
.dt-sidebar-item {
300-
width: var(--dt-size-100-percent);
300+
inline-size: var(--dt-size-100-percent);
301301
}
302302
</style>

apps/dialtone-documentation/docs/components/stack.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,84 +1702,84 @@ vueCode='
17021702

17031703
// Inline axis indicators (vertical lines)
17041704
&--inline-start::before {
1705-
left: var(--axis-offset);
1706-
width: var(--axis-size);
1707-
height: 100%;
1705+
inset-inline-start: var(--axis-offset);
1706+
inline-size: var(--axis-size);
1707+
block-size: 100%;
17081708
}
17091709

17101710
&--inline-center::before {
1711-
left: 50%;
1712-
top: 50%;
1711+
inset-inline-start: 50%;
1712+
inset-block-start: 50%;
17131713
transform: translate(-50%, -50%);
1714-
width: var(--axis-size);
1715-
height: 100%;
1714+
inline-size: var(--axis-size);
1715+
block-size: 100%;
17161716
}
17171717

17181718
&--inline-end::before {
1719-
right: var(--axis-offset);
1720-
width: var(--axis-size);
1721-
height: 100%;
1719+
inset-inline-end: var(--axis-offset);
1720+
inline-size: var(--axis-size);
1721+
block-size: 100%;
17221722
}
17231723

17241724
&--inline-stretch {
17251725
&::before {
1726-
left: var(--axis-offset);
1727-
width: var(--axis-size);
1728-
height: 100%;
1726+
inset-inline-start: var(--axis-offset);
1727+
inline-size: var(--axis-size);
1728+
block-size: 100%;
17291729
}
17301730

17311731
&::after {
1732-
right: var(--axis-offset);
1733-
width: var(--axis-size);
1734-
height: 100%;
1732+
inset-inline-end: var(--axis-offset);
1733+
inline-size: var(--axis-size);
1734+
block-size: 100%;
17351735
}
17361736
}
17371737

17381738
// Block axis indicators (horizontal lines)
17391739
&--block-start::before {
1740-
top: var(--axis-offset);
1741-
height: var(--axis-size);
1742-
width: 100%;
1740+
inset-block-start: var(--axis-offset);
1741+
block-size: var(--axis-size);
1742+
inline-size: 100%;
17431743
background-image: var(--axis-pattern-horizontal);
17441744
}
17451745

17461746
&--block-center::before {
1747-
left: 50%;
1748-
top: 50%;
1747+
inset-inline-start: 50%;
1748+
inset-block-start: 50%;
17491749
transform: translate(-50%, -50%);
1750-
width: 100%;
1751-
height: var(--axis-size);
1750+
inline-size: 100%;
1751+
block-size: var(--axis-size);
17521752
background-image: var(--axis-pattern-horizontal);
17531753
}
17541754

17551755
&--block-end::before {
1756-
bottom: var(--axis-offset);
1757-
height: var(--axis-size);
1758-
width: 100%;
1756+
inset-block-end: var(--axis-offset);
1757+
block-size: var(--axis-size);
1758+
inline-size: 100%;
17591759
background-image: var(--axis-pattern-horizontal);
17601760
}
17611761

17621762
&--block-stretch {
17631763
&::before {
1764-
top: var(--axis-offset);
1765-
height: var(--axis-size);
1766-
width: 100%;
1764+
inset-block-start: var(--axis-offset);
1765+
block-size: var(--axis-size);
1766+
inline-size: 100%;
17671767
background-image: var(--axis-pattern-horizontal);
17681768
}
17691769

17701770
&::after {
1771-
bottom: var(--axis-offset);
1772-
height: var(--axis-size);
1773-
width: 100%;
1771+
inset-block-end: var(--axis-offset);
1772+
block-size: var(--axis-size);
1773+
inline-size: 100%;
17741774
background-image: var(--axis-pattern-horizontal);
17751775
}
17761776
}
17771777

17781778
// Special case for baseline
17791779
&--baseline::before {
1780-
bottom: calc(var(--dt-size-500) + var(--dt-size-400));
1781-
height: var(--axis-size);
1782-
width: 100%;
1780+
inset-block-end: calc(var(--dt-size-500) + var(--dt-size-400));
1781+
block-size: var(--axis-size);
1782+
inline-size: 100%;
17831783
background-image: var(--axis-pattern-horizontal);
17841784
}
17851785
}

apps/dialtone-documentation/docs/foundations/colors/themes/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ When creating a custom theme, it is important to ensure that the colors used are
341341

342342
<style scoped>
343343
.color-swatch {
344-
width: 24px;
345-
height: 24px;
346-
border-radius: 4px;
347-
border: 1px solid var(--dt-color-black-300);
344+
inline-size: var(--dt-size-550);
345+
block-size: var(--dt-size-550);
346+
border-radius: var(--dt-size-radius-300);
347+
border: var(--dt-size-border-100) solid var(--dt-color-border-default);
348348
flex-shrink: 0;
349349
}
350350
</style>

0 commit comments

Comments
 (0)