Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !28092

Add `deprecate()` mixin

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge v4-dev-mc-deprecate into v4-dev 6 years ago
  • Overview 0
  • Commits 6
  • Pipelines 0
  • Changes 5

Created by: MartijnCuppens

We're probably going to drop a lot of mixins, and maybe some functions in v5. That's why I would like to introduce a deprecate() mixin. This mixin will allow us to deprecate mixins and functions now. Its goal is that all functions/mixins that will be droped in v5 include this mixin so that it'll be easy to check if people are relying on deprecated stuff in their codebase if they want to upgrade from Bootstrap 4 to 5. (They can update to the latest v4 first where all the deprecate() mixins are included.)

I've put #28072, #28067 and #28066 hold for this (I acctually tought $ignore-warning was a global variable, which wasn't the case). Probably going to submit a lot more deprecation PRs (these won't be blocking the 4.3 release)

Compare
  • v4-dev (base)

and
  • latest version
    db8ab90a
    6 commits, 2 years ago

5 files
+ 16
- 3

    Preferences

    File browser
    Compare changes
sc‎ss‎
mix‎ins‎
_deprec‎ate.scss‎ +10 -0
_text-h‎ide.scss‎ +1 -3
_mixin‎s.scss‎ +3 -0
_variab‎les.scss‎ +1 -0
site/docs/4.2/‎getting-started‎
themi‎ng.md‎ +1 -0
scss/mixins/_deprecate.scss 0 → 100644
+ 10
- 0
  • View file @ db8ab90a

  • Edit in single-file editor

  • Open in Web IDE

// Deprecate mixin
//
// This mixin can be used to deprecate mixins or functions.
// `$enable-deprecation-messages` is a global variable, `$ignore-warning` is a variable that can be passed to
// some deprecated mixins to suppress the warning (for example if the mixin is still be used in the current version of Bootstrap)
@mixin deprecate($name, $deprecate-version, $remove-version, $ignore-warning) {
@if ($enable-deprecation-messages != false and $ignore-warning != true) {
@warn "#{$name} has been deprecated as of #{$deprecate-version}. It will be removed entirely in #{$remove-version}.";
}
}
scss/mixins/_text-hide.scss
+ 1
- 3
  • View file @ db8ab90a

  • Edit in single-file editor

  • Open in Web IDE


@@ -7,7 +7,5 @@
background-color: transparent;
border: 0;
@if ($ignore-warning != true) {
@warn "The `text-hide()` mixin has been deprecated as of v4.1.0. It will be removed entirely in v5.";
}
@include deprecate("`text-hide()`", "v4.1.0", "v5", $ignore-warning);
}
scss/_mixins.scss
+ 3
- 0
  • View file @ db8ab90a

  • Edit in single-file editor

  • Open in Web IDE


@@ -2,6 +2,9 @@
//
// Used in conjunction with global variables to enable certain theme features.
// Deprecate
@import "mixins/deprecate";
// Utilities
@import "mixins/breakpoints";
@import "mixins/hover";
scss/_variables.scss
+ 1
- 0
  • View file @ db8ab90a

  • Edit in single-file editor

  • Open in Web IDE


@@ -117,6 +117,7 @@ $enable-grid-classes: true !default;
$enable-pointer-cursor-for-buttons: true !default;
$enable-print-styles: true !default;
$enable-validation-icons: true !default;
$enable-deprecation-messages: true !default;
// Spacing
site/docs/4.2/getting-started/theming.md
+ 1
- 0
  • View file @ db8ab90a

  • Edit in single-file editor

  • Open in Web IDE


@@ -243,6 +243,7 @@ You can find and customize these variables for key global options in Bootstrap's
| `$enable-pointer-cursor-for-buttons` | `true` (default) or `false` | Add "hand" cursor to non-disabled button elements. |
| `$enable-print-styles` | `true` (default) or `false` | Enables styles for optimizing printing. |
| `$enable-validation-icons` | `true` (default) or `false` | Enables `background-image` icons within textual inputs and some custom forms for validation states. |
| `$enable-deprecation-messages` | `true` or `false` (default) | Set to `true` to show warnings when using any of the deprecated mixins and functions that are planned to be removed in `v5`. |
## Color
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: firstcontributions/first-contributions!56801
Source branch: v4-dev-mc-deprecate

Menu

Explore Projects Groups Snippets