-
Notifications
You must be signed in to change notification settings - Fork 0
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
I'm struggling with setting up the library #824
Comments
Thanks for taking notes! 🙏 Yes some of the process can be painful still, sorry for that. It’s clear we’ve never quite struck the right balance for the use cases we’re trying to cover. I think many issues come from just a few sources (probably there are more!):
Taking your issues one by one here, let me know what you think: 1. The library tries to load custom font filesA description of what is currently needed to get the build green should at least be added to the documentation. We want a custom font to applied consistently for some projects such as admin interfaces — those ideally all have matching branding by default — and to the storybook here. Ideally I think the out-of-the-box results should match what’s shown in our storybook, anything else I would find confusing. For many projects (the public-facing apps, mainly) changing the webfoot is the first thing that’s done — that’s very much part of the initial setup, along with all the other design tokens. But that doesn’t mean we should be proscriptive and require that of course.
2. Customization examples from docs doesn't workYes, simplest case would be that we update any references to importing It is possible to use the current single import, but it means knowing Sass modules (or we add it to our documentation so that users know about it). Each module in Sass adds its own name to the variable that it forwards/exports. So your example from number 3, which didn’t work for you: @use '~bitstyles/scss/bitstyles/design-tokens/primary' with (
$webfont-family-name: 'Arial',
$webfont-variants: (),
); It didn’t work because each of the modules that are forwarded by @use '~bitstyles/scss/bitstyles/design-tokens/primary' with (
$typography-webfont-family-name: 'Arial',
$typography-webfont-variants: (),
); That’s because the Sass module forwarded by
Those variables are covered in I’ll have to come back and finish off tomorrow, I hope that’s ok :) |
Continued… ✘ [ERROR] Can't find stylesheet to import.
@use '~bitstyles/scss/bitstyles/design-tokens' with
// ... This error could also be fixed if we added a default import file i.e. ✘ [ERROR] "Oops! Breakpoint ‘l3’ does not exist."
╷
63 │ @include media-query.get($breakpoint) { This is a bug that was introduced when changing the naming of the spacing scale — there is no breakpoint I think the final remaining problem you described is another example of out-of-date documentation: @use '~bitstyles/scss/bitstyles/design-tokens/primary' with (
$color-palette-text: #fff,
$layout-size-base: 1.2rem
/* lots of other options here */
);
The error is correct, and this isn’t a case of needing to add a module-name prefix, the variable doesn’t exist. Text color and background-color are now handled in the default theme. I would suggest updating the example in the documentation to override a different variable from the base design tokens would be the best solution. There’s a lot here to cover, but I think many of these issues can be fixed with a couple of changes (a couple of PRs, at least). Feedback and thoughts on all this are totally welcome — I would prefer to do this slowly and correctly rather than rush to make changes. Your input on any changes to the documentation would also be great, to make sure it’s clear and doesn’t assume too much domain knowledge. |
I am trying to add bitstyles to a new project without changing any configuration. It is difficult.
I would like to just write:
and be able to use the library without any configuration but that's not possible.
Here are my problems:
1. The library tries to load custom font files
The first errors I see is this (truncated):
The instructions on https://bitcrowd.github.io/bitstyles/?path=/story/introduction-getting-started--page do not mention that I need to do to anything special to make fonts work. They mention:
But doing that does not resolve the font problems.
I don't want to have any fancy fonts at this stage of the project, I would be happy with a basic system-built in font. So I would like to overwrite the bitstyles config and not have to provide any custom font files.
2. Customization examples from docs doesn't work
When I want to start customizing the bitstyles config to change the font, I copy-paste this example from https://bitcrowd.github.io/bitstyles/?path=/story/introduction-getting-started--page :
This example gives me this error:
I can figure out by looking at the source code that there are two main design-token files, "primary" and "secondary" so I change it to:
Which then produces a new error:
So I remove that variable from the file, which then produces this error:
Which leaves me with this code with no overriding any variables:
3. How exactly do I customize bitstyles to stop importing a font file?
I had to read the source code to know that I can override
$webfont-family-name
to change thedefault font family and$webfont-variants
to an empty array to stop any font files from getting imported. At first I tried to do:Which doesn't work. I am forced to copy-paste the whole "primary" file into my bitstyles configuration in order to overwrite the fonts.
TL;DR: the simplest bitstyles configuration that compiles for me was this:
This process is not really obvious. It would be great to have public docs explaining how to approach creating config overrides.
The text was updated successfully, but these errors were encountered: