-
Notifications
You must be signed in to change notification settings - Fork 3
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
Rules List #340
Rules List #340
Conversation
Very nice! These go great together, and I'm glad we're finally linking them from the main page. I haven't had a chance to look at the code, but some visual thoughts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@@ -93,7 +93,6 @@ | |||
} | |||
} | |||
|
|||
/* TODO: Check why this is here, can we remove this? */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean you figured it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested around a bit, and realised 2 things:
1.) We can view these as changes to the "default styles" of css, and I think these are good.
2.) Components can still overwrite these styles if need be.
I added this TODO when I added some detailed rules, and the markdown is displayed differently than I expected. For the rules it might still be worth to overwrite this, but it's fine for now imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks for the explanation!
@@ -0,0 +1,7 @@ | |||
export function toUpperCaseFirstLetter(string: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside: Not a priority, but I feel like we should have some UI-friendly strings defined. The variant names are not really designed to be shown to the user.
v-for="variant in variantsWithRulesDescription" | ||
:key="variant" | ||
class="rules-link" | ||
v-bind:to="{ name: 'rules', params: { variant: variant } }" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: Because of the inconsistency between :key
and v-bind:to
I want to point out, that :
is a shorthand for v-bind:
. See Vue's v-bind directive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might consider a lint rule (vue/v-bind-style or vue/vue3-strongly-recommended). We're pretty inconsistent across the codebase unfortunately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it, will try to be more consistent! 😄 Thanks!
font-family: "helvetica", "arial", "sans-serif"; | ||
} | ||
|
||
.grid-page-layout { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the class that is used in the demo view? That could be clarified with a comment maybe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't <style scoped>
prevent the style from getting used in DemoView anyway (without deep selector)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is what we renamed pageWrapper to. AFAIK with scoped it should only be applied to this component, and not its child components. see https://vue-loader.vuejs.org/guide/scoped-css.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I missed that the class was applied in this file too (I just saw it being deleted, overlooked it in the added part).
But:
With scoped, the parent component's styles will not leak into child components. However, a child component's root node will be affected by both the parent's scoped CSS and the child's scoped CSS. This is by design so that the parent can style the child root element for layout purposes.
SFC CSS Features | Vue.js
So I think it gets applied to both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the documentation means with root node
. Does this mean the DOM tree?
But I tried it, and indeed the style is applied to both in this case. Good to know!
I've pushed a change that makes sure it's only applied to the rules page layout in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DemoView has <template><div class="grid-page-layout"> ... </div></template>
, I think the template is ignored, so the <div class="grid-page-layout">
is the root node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know about that, thanks for explaining!
Thanks for the feedback! I've increased the padding on mobile to 12px (for all pages using grid-page-layout), and added some limits for the width of the text column. |
This adds a new view that is linked to in the NavBar and has links to the rules page for variants with a (detailed) rules description.
Also I've added the demo board to the rules view as proposed in #112
I wasn't able to make sure that the demo board fits, so I made its container scrollable on overflow.
Rules List
Rules Page