-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: Add missing colour vars and Column export, lineClamp support, Color, Heading, Text demos #471
Conversation
Do we really need this? There's a bit of an intended tendency to restrict what we can do with regards to customizing the design of some components. While Braid goes to the opposite end and disallows many of these things in most of their components, I made it so that the main layout components can do this without having to be wrapped inside an additional Would love to hear your thoughts about this. PS: Will review in full later. |
aaad5b1
to
9d100d8
Compare
<section className="story"> | ||
<Stack space="medium"> | ||
<Text size="xlarge" weight="strong" tone="secondary"> | ||
Text, xlarge, strong, secondary (16px) |
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.
Should xlarge
use a larger font-size?
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.
Why do you ask? Is it using the same size as the previous one in the scale? If so, then maybe yes.
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.
Yep, both are 16px. I've created a post to align with design and you on this so we may make more changes here after 👍
Yeah, I guess that makes sense. I can remove the padding addition tomorrow and use it a little while longer before seeing whether this is truly needed. If you review before I do this, just ignore those changes - I'll drop the commit and update the storybook demo 👍 |
If we have elements in a stack (or inline) with non-uniform spacing, then I guess the alternative for now is to use |
That last one is indeed a very good idea! I'll add a third option for a case like this: push back to the designer to see if we can get by with the uniform approach. It may not always go through, but in my experience with Alex during the new settings DO, it has worked a few times. |
h4.size-larger, | ||
h5.size-larger, | ||
h6.size-larger { | ||
font-size: var(--reactist-font-size-large); | ||
} | ||
|
||
/* h4/h5/h6 can't be made smaller, maybe we reconsider this? */ | ||
|
||
/* truncated text */ |
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.
From the use of this feature in the stories, it seems this is to truncate to a certain number of lines, right? And when using lineClamp={1}
, is it equivalent to Braid's truncate
prop? (ref).
I ask because I recently introduced in Todoist the truncate
prop and was meaning to bring it to Reactist these days. But this line clamp thing seems to be more comprehensive if it covers multi-line cases, while still behaving as truncate
for a single line.
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 .line-clamp-1 applies text-overflow: ellipsis;
instead of -webkit-line-clamp
.
The vendor prefixes are required since autoprefixer doesn't handle this for now: postcss/autoprefixer#1322
.line-clamp-1 { | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
overflow: hidden; | ||
} | ||
|
||
.lineClamp { | ||
display: -webkit-box; | ||
-webkit-box-orient: vertical; | ||
overflow: hidden; | ||
} | ||
|
||
.line-clamp-2 { | ||
-webkit-line-clamp: 2; | ||
} | ||
.line-clamp-3 { | ||
-webkit-line-clamp: 3; | ||
} | ||
.line-clamp-4 { | ||
-webkit-line-clamp: 4; | ||
} | ||
.line-clamp-5 { | ||
-webkit-line-clamp: 5; | ||
} |
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.
If we ever need this in a third component we should consider extracting it into a reusable CSS module that any component module could import.
<section className="story"> | ||
<Stack space="medium"> | ||
<Text size="xlarge" weight="strong" tone="secondary"> | ||
Text, xlarge, strong, secondary (16px) |
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.
Why do you ask? Is it using the same size as the previous one in the scale? If so, then maybe yes.
84745ba
to
0e5dcbe
Compare
0e5dcbe
to
bfe860f
Compare
008e568
to
95066bd
Compare
Short description
This adds a couple of improvements to the Design System components:
Column
componentAddspadding
prop toText
andHeading
componentslineClamp
prop toText
andHeading
componentslargest
value to thesize
prop for theHeading
componentText
component were not definedHeading
.Text
, and our available coloursWe still have issues with stylesheets in the gh-pages build of storybook, but this would at least give us a reference in dev mode before we can fix it.
PR Checklist
npm run validate
and made sure no errors / warnings were shownCHANGELOG.md
package.json
andpackage-lock.json
(npm --no-git-tag-version version <major|minor|patch>
) refnpm run build-all
)Versioning
v9.1.0-beta.3