Skip to content

Conversation

@ilharp
Copy link
Contributor

@ilharp ilharp commented Jul 31, 2021

@ilharp ilharp marked this pull request as draft July 31, 2021 18:30
@ilharp ilharp marked this pull request as ready for review July 31, 2021 18:46
@ilharp ilharp marked this pull request as draft July 31, 2021 18:49
Copy link
Contributor Author

@ilharp ilharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b340f27

Removed --t vars in other plugins. This will cause transform-duration of these plugins to remain unchanged when user modifies --t-duration.

@ilharp ilharp marked this pull request as ready for review July 31, 2021 19:06
Comment on lines 70 to 79
--t-duration: 0.3s;
--t-duration-slide: 0.3s;
--t-all: all var(--t-duration);
--t-opacity: opacity var(--t-duration);
--t-color: color var(--t-duration);
--t-border-color: border-color var(--t-duration);
--t-background-color: background-color var(--t-duration);
--t-color-all: var(--t-color), var(--t-border-color),
var(--t-background-color);
--t-transform: transform var(--t-duration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that transition-timing-function is not supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 2 to 6
transition: all 0.3s ease;
transition: all var(--t-duration-slide) ease;
}

.fade-slide-y-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
transition: all var(--t-duration-slide) cubic-bezier(1, 0.5, 0.8, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the other parts of are not customizable, I think we could just leave the duration constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 70 to 72
--t-duration: 0.3s;
--t-duration-slide: 0.3s;
--t-timing-function: ease;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could merge them into a single var, because "duration" and "timing function" always appear together in following usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

822d845

OK. Users can control transition-duration, transition-timing-function and transition-delay in a single variable in this way.

Comment on lines 70 to 78
--t-options: 0.3s ease;
--t-all: all var(--t-options);
--t-opacity: opacity var(--t-options);
--t-color: color var(--t-options);
--t-border-color: border-color var(--t-options);
--t-background-color: background-color var(--t-options);
--t-color-all: var(--t-color), var(--t-border-color),
var(--t-background-color);
--t-transform: transform var(--t-options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing: there are two different naming patterns

  • --t-${propertyName}: --t-all, --t-opacity, --t-color
  • --t-${somethingElse}: --t-options, --t-color-all

Any good idea to normalize the naming pattern?

Copy link
Member

@meteorlxy meteorlxy Aug 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe an extra prefix --t-p- for property name? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 71 to 78
--t-p-all: all var(--t-options);
--t-p-opacity: opacity var(--t-options);
--t-p-transform: transform var(--t-options);
--t-p-color: color var(--t-options);
--t-p-border-color: border-color var(--t-options);
--t-p-background-color: background-color var(--t-options);
--t-color-all: var(--t-p-color), var(--t-p-border-color),
var(--t-p-background-color);
Copy link
Member

@meteorlxy meteorlxy Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, after some discussion, both @shigma and me think we might not need so many vars for transitions.

IMO, only the --t-options is helpful for reusing the transition options. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this PR is intended to provide scalability, I believe consistency is also important to a theme.

For theme-default, two transition variables are enough. One for color (color, border-color, background-color, etc) and the other for position (left, right, top, bottom, width, height, transform, etc).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3906192

What naming convention is better to use in _variables.scss?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using color var(--t-color-options) directly is enough 🤔 No need to add extra scss variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,3 +1,5 @@
@import '_variables';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@meteorlxy meteorlxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. What's your opinion @shigma ?

@meteorlxy meteorlxy requested a review from shigma August 12, 2021 11:53
@meteorlxy meteorlxy changed the title feat(theme-default): add transition variables feat(theme-default): add css variables for transition Aug 13, 2021
@meteorlxy meteorlxy merged commit 2b09004 into vuepress:main Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants