Skip to content

Conversation

dmitry-stepanenko
Copy link
Contributor

@dmitry-stepanenko dmitry-stepanenko commented Nov 1, 2021

Related Issue

Is being done as part of the fix for SAP/fundamental-ngx#5286

Description

Added styles for dialog without backdrop

Screenshots

NOTE: If you've made any style changes, please provide appropriate screenshots (before and after) to help reviewers.

To see examples of which screenshots to include, go to Screenshot Examples.

Before:

After:

Please check whether the PR fulfills the following requirements

  1. The output matches the design specs
  • All values are in rem
  • Text elements follow the truncation rules
  • hover state of the element follow design spec
  • focus state of the element follow design spec
  • active state of the element follow design spec
  • selected state of the element follow design spec
  • selected hover state of the element follow design spec
  • pressed state of the element follow design spec
  • Responsiveness rules - the component has modifier classes for all breakpoints
  • Includes Compact/Cosy/Tablet design
  • RTL support
  1. The code follows fundamental-styles code standards and style
  • only one top level fd-* class is used in the file
  • BEM naming convention is used
  • Mixins are used for repeatable code (fd-rtl, fd-ellipsis, fd-flex, fd-selected, fd-focus, ect.)
  • A11y support - keyboard support, screenreader support, proper ARIA attributes, etc.
  • fd-reset() mixin is applied to all elements
  • Variables are used, if some value is used more than twice.
  • Checked if current components can be reused, instead of having new code.
  1. Testing
  • tested Storybook examples with "CSS Resources" normalize option
  • tested Storybook examples with "CSS Resources" unnormalize option
  • [n/a] Verified all styles in IE11
  • [n/a] Updated tests
  • last commit message should have [ci visual] so it can trigger chromatic visual regression (e.g. test: run chromatic visual regression [ci visual])
  1. Documentation
  • Storybook documentation has been created/updated
  • Breaking Changes wiki has been updated in case of breaking changes.

@dmitry-stepanenko
Copy link
Contributor Author

@InnaAtanasova I'll add breaking changes once PR is approved

@netlify
Copy link

netlify bot commented Nov 1, 2021

✔️ Deploy Preview for fundamental-styles ready!

🔨 Explore the source changes: 75c6ef0

🔍 Inspect the deploy log: https://app.netlify.com/sites/fundamental-styles/deploys/6182b604784bd20008fb2f52

😎 Browse the preview: https://deploy-preview-2877--fundamental-styles.netlify.app

}
}

&__no-backdrop:not(.#{$block}__targeted) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a modifier class or an element? Because from the naming it looks like you are introducing a new html element with the class .fd-dialog__no-backdrop. If it's a modifier class, added on the same level as .fd-dialog, then you should have a different naming, like .fd-dialog--no-backdrop.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

}

&__no-backdrop:not(.#{$block}__targeted) {
position: fixed;
Copy link
Contributor

Choose a reason for hiding this comment

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

why the position is fixed and not absolute?

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's absolute you can use the mixin we already have for this:

@mixin fd-absolute-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, I decided to keep fixed because it centers the element in the view, not in the parent. Although in fundamental-ngx both fixed and absolute will work (because parent fd-dialog-container is attached directly to body), it feels reasonable to provide unified solution, that works well in all scenarios

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome :) In this case please adjust the fd-absolute-center mixin to accept as parameter the position and reuse it in your code.
You can do something like:

@mixin fd-absolute-center($position: absolute) {
  position: $position; 
  left: 50%;
  top: 50%; 
  transform: translate(-50%, -50%); 
}

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also rename the mixin to fd-position-center or something similar to make more sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, done

@InnaAtanasova
Copy link
Contributor

@InnaAtanasova I'll add breaking changes once PR is approved

Usually you add the Breaking changes before opening the PR as the reviewer's job is to make sure they are added. If you get the approval nothing stops you from merging the PR and there's no guarantee that you will add the Breaking changes.

@dmitry-stepanenko dmitry-stepanenko force-pushed the ds/5286-dialog-no-backdrop branch from a99ac16 to e2f6753 Compare November 1, 2021 18:19
@dmitry-stepanenko
Copy link
Contributor Author

@InnaAtanasova I'll add breaking changes once PR is approved

Usually you add the Breaking changes before opening the PR as the reviewer's job is to make sure they are added. If you get the approval nothing stops you from merging the PR and there's no guarantee that you will add the Breaking changes.

Updated the wiki

@dmitry-stepanenko dmitry-stepanenko force-pushed the ds/5286-dialog-no-backdrop branch 2 times, most recently from ba178f9 to f545a75 Compare November 2, 2021 15:28
Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

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

Works well 👍

@InnaAtanasova
Copy link
Contributor

@dmitry-stepanenko you need to trigger the visual checks

@dmitry-stepanenko dmitry-stepanenko force-pushed the ds/5286-dialog-no-backdrop branch from f545a75 to 66b535a Compare November 3, 2021 14:45
@dmitry-stepanenko dmitry-stepanenko force-pushed the ds/5286-dialog-no-backdrop branch from 66b535a to 75c6ef0 Compare November 3, 2021 16:17
@InnaAtanasova
Copy link
Contributor

🚀

@droshev droshev merged commit a35f960 into main Nov 3, 2021
@droshev droshev deleted the ds/5286-dialog-no-backdrop branch November 3, 2021 20:00
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.

4 participants