Skip to content
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

feat: Adjustable config and sensible defaults #27

Closed
csshugs opened this issue Apr 30, 2020 · 1 comment
Closed

feat: Adjustable config and sensible defaults #27

csshugs opened this issue Apr 30, 2020 · 1 comment
Labels
improvement Change or improve existing feature
Milestone

Comments

@csshugs
Copy link
Owner

csshugs commented Apr 30, 2020

Currently, the user has to completely override the $FLUIDMS-CONFIG map in order to adjust individual attributes of the Sass map. The current default of $FLUIDMS-CONFIG is this:

$FLUIDMS-CONFIG: (
    min-font-size: 16px,
    max-font-size: 24px,
    min-viewport: 480px,
    max-viewport: 1280px,
    ratio: 1.1,
    768px: (
        ratio: 1.2,
    ),
    1280px: (
        ratio: 1.3,
    ),
    scales: (
        6,
        5,
        4,
        3,
        2,
        1,
        0,
        -1,
        -2,
        -3,
    ),
) !default;

Let’s say, the user only wants to adjust the min-font-size to 18px. What they need to do is to override the map with this:

$FLUIDMS-CONFIG: (
    min-font-size: 18px,
    max-font-size: 24px,
    min-viewport: 480px,
    max-viewport: 1280px,
    ratio: 1.1,
    768px: (
        ratio: 1.2,
    ),
    1280px: (
        ratio: 1.3,
    ),
    scales: (
        6,
        5,
        4,
        3,
        2,
        1,
        0,
        -1,
        -2,
        -3,
    ),
) !default;

It would be way easier for the user to just adjust the map entry they actually want to change from the default without the need to manually copy all the contents from the original Sass map:

$FLUIDMS-CONFIG: (
    min-font-size: 18px
) !default;

If we do this, we need to overthink our current defaults of the $FLUIDMS-CONFIG Sass map, as we couldn’t remove e.g. custom breakpoint ratios. The following seems like a more sensible default config, as in it is usable right off the bat in any project with only slight adjustments (i.e. less opinionated):

$FLUIDMS-CONFIG: (
    min-font-size: 15px,
    max-font-size: 20px,
    min-viewport: 480px,
    max-viewport: 1280px,
    ratio: 1.15,
    scales: (
        6,
        5,
        4,
        3,
        2,
        1,
        0,
        -1,
        -2,
    ),
) !default;
@csshugs csshugs added the improvement Change or improve existing feature label Apr 30, 2020
@csshugs csshugs added this to the 0.2.1 milestone Apr 30, 2020
csshugs added a commit that referenced this issue Apr 30, 2020
because:
- currently, the user has to override the complete `$FLUIDMS-CONFIG`
Sass map in order to change only one entry of that list

this commit:
- provides a way to adjust individual attributes of the config
- simplifies the default `$FLUIDMS-CONFIG` map
csshugs added a commit that referenced this issue May 18, 2020
because:
- currently, the user has to override the complete `$FLUIDMS-CONFIG`
Sass map in order to change only one entry of that list

this commit:
- provides a way to adjust individual attributes of the config
- simplifies the default `$FLUIDMS-CONFIG` map
csshugs added a commit that referenced this issue May 18, 2020
because:
- currently, the user has to override the complete `$FLUIDMS-CONFIG`
Sass map in order to change only one entry of that list

this commit:
- provides a way to adjust individual attributes of the config
- simplifies the default `$FLUIDMS-CONFIG` map
@csshugs
Copy link
Owner Author

csshugs commented May 18, 2020

#29 is merged.

@csshugs csshugs closed this as completed May 18, 2020
csshugs added a commit that referenced this issue May 18, 2020
because:
- currently, the user has to override the complete `$FLUIDMS-CONFIG`
Sass map in order to change only one entry of that list

this commit:
- provides a way to adjust individual attributes of the config
- simplifies the default `$FLUIDMS-CONFIG` map
@csshugs csshugs modified the milestones: 0.2.1, 0.2.2 May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Change or improve existing feature
Projects
None yet
Development

No branches or pull requests

1 participant