Commit Graph

220 Commits

Author SHA1 Message Date
dependabot[bot]
64bcedc8b2 Bump sassc-embedded from 1.70.1 to 1.80.1
Note: Since we update to 1.80.1 deprecation warnings are appear when execute the assets:precompile command.
In order to silence this deprecation, we add silence_deprecation option in sass.rb initializer.

The code has also been updated to remove the deprecation warnings that appeared related to the function
darken(), lighten() and "Using / for division" instead of the function calc().

Bumps [sassc-embedded](https://github.com/sass-contrib/sassc-embedded-shim-ruby) from 1.70.1 to 1.80.1.
- [Commits](https://github.com/sass-contrib/sassc-embedded-shim-ruby/compare/v1.70.1...v1.80.1)

---
updated-dependencies:
- dependency-name: sassc-embedded
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-06 13:01:58 +01:00
Javi Martín
2ccf725815 Add properties-alphabetical-order Stylelint rule
We hadn't added this rule before because there was no such rule in
scss-lint. Instead, we were following it without a linter, and so we
unintentionally broke it sometimes.

But now we're using Stylelint, so we can add the rule and let the linter
check we're still following it.
2024-07-22 17:34:08 +02:00
Javi Martín
5f590cb59b Remove obsolete CSS rule for accordion titles
The `accordion-title` HTML class isn't used since commit 156997d93.
2024-04-18 15:48:21 +02:00
Javi Martín
ccf5c81ea9 Use a button to destroy pages from the edit page
We were already using buttons to destroy pages from the pages index.

As mentioned in commits 5311daadf and bb958daf0, using links combined
with JavaScript to generate POST (or, in this case, DELETE) requests to
the server has a few issues.
2024-04-17 17:31:34 +02:00
Javi Martín
fc4940ccb6 Move edit page and new page views to components
This way we can simplify setting the title and styling the link in the
header. We're also fixing the unnecessary padding introduced by the
`column` classes, which caused the header not to be aligned with the
rest of the elements surrounding it. We're still keeping it the margin
used in the `row` classes so it's aligned with the rest of the form;
ideally, we would remove the `row` classes in the rest of the form and
in the whole admin section, but this isn't something we can tackle right
now.

Note that, in the CSS, the `margin-left: auto` property needs to be
included after `@include regular-button` because that mixin overwrites
the `margin-left` property. Since we're modifying this code, we're
making it compatible with RTL text, using `$global-left` instead of
`left`.
2024-04-17 17:29:36 +02:00
Javi Martín
6df813fdb6 Use calc() where divisions are involved
The division operator `/` from Sass is deprecated because `/` is used in
CSS for uses other than dividing numbers. That's why we were getting
many warnings like:

```
Deprecation Warning: Using / for division outside of calc() is
deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($line-height, 2) or calc($line-height / 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

margin-top: $line-height / 2;
```

Since using math.div makes the code harder to read and `calc` is
universally supported by all browsers (although the implementation in
Internet Explorer doesn't work in certain cases), we're using `calc`
when assigning the value to a CSS property.

However, we're also using divisions when assigning Sass variables, and
in those cases using `calc` is trickier because sometimes these
variables are used in other operations. We'll handle these cases in the
next commit.
2024-04-04 15:16:24 +02:00
Javi Martín
e210682ac0 Replace SCSS Lint with Stylelint
SCSS Lint was based on Ruby Sass, which has been deprecated since 2018
and doesn't support some of the latest features in Dart Sass.

Since we're going to migrate to Dart Sass, we're also migrating to
Stylelint. In order to provide all the funcionality SCSS Lint had, we
also need to install a few Stylelint plugins. We also need to install
the `postcss-scss` package so Stylelint can read SCSS files.

We're still getting the linting errors we used to get in
`legislation_process.scss` because of the `max-nesting-depth` and
`selector-max-compound-selectors` rules, as well as the warnings we used
to get in `layout.scss` because the `ssb-whatsapp_app` HTML class
contains undescores in their name.

We're also getting a couple of new linting errors, which could be false
positives:

* The `scss/no-unused-private-members` rule reports errors in
  `_consul_settings.scss` because of the `$-zf-*` variables, but I'm not
  too worried about this one because these lines won't be necessary after
  updating Foundation.
* The `scss/selector-no-redundant-nesting-selector` reports an error in
  `datepicker_overrides.scss`, but removing the unnecessary nesting
  selector would make it harder to understand the code (assuming it'd
  work in the first place).

We've changed some files due to few differences between SCSS Lint rules
and their Stylelint equivalents:

* The `@stylistic/string-quotes` rule detects a case in `admin.scss`
  that StringQuotes didn't detect.
* The `function-url-quotes` rule detects a case in `mixins/icons.scss`
  that UrlQuotes didn't detect.
* The `@stylistic/declaration-bang-space-before` rule detects a case in
  `sdg/goals/show.scss` that BangFormat didn't detect.

There are also a couple of rules that don't behave exactly like they
used to:

* The equivalents of SpaceBetweenParens and SpaceAfterComma don't cover
  parenthesis or commas in mixin parameters; we haven't found rules that
  detect these cases.
* DisableLinterReason probably has an equivalent that behaves
  differently but, since we never disable linters inline, we aren't
  adding its equivalent rule.

Note we're removing the SpaceAfterVariableColon rule because its
equivalent, `scss/dollar-variable-colon-space-after`, reports cases
where we add spaces to indent several variable assignments (which we do
a lot in the `_consul_settings.scss` file). We might add this rule again
if we stop aligning consecutive assignments.

We're also removing the QualifyingElement rule because its equivalent,
`selector-no-qualifying-type: true`, behaves differently. For example,
in this code:

```
a.qualifying {
  color: inherit;
}

p {
  &.qualifying {
    color: inherit;
  }
}
```

With the QualifyingElement from SCSS Lint, the first rule is incorrect
but the second one is correct. With the selector-no-qualifying-type rule
from Stylelint, on the other hand, both rules are incorrect.

Personally, I never liked the QualifyingElement rule, and we were
working around it anyway, so we aren't applying
selector-no-qualifying-type.

For reference, here's a full list of the SCSS Lint rules we had enabled
and their Stylelint equivalents.

BangFormat
"@stylistic/declaration-bang-space-after": "never"
"@stylistic/declaration-bang-space-before": "always"

BorderZero
declaration-property-value-disallowed-list:
  border:
    - none

ColorKeyword
color-named: "never"

DebugStatement
at-rule-disallowed-list:
  - debug

DeclarationOrder
order/order:
  - dollar-variables
  - custom-properties
  - type: at-rule
    name: extend
  - type: at-rule
    name: include
    hasBlock: false
  - declarations
  - type: at-rule
    name: include
    hasBlock: true
  - rules

ElsePlacement # Apparently replaced by the combination of:
scss/at-else-closing-brace-space-after: always-intermediate
scss/at-else-empty-line-before: never
scss/at-if-closing-brace-space-after: always-intermediate
scss/at-if-closing-brace-newline-after: always-last-in-chain

EmptyLineBetweenBlocks:
  ignore_single_line_blocks: true
rule-empty-line-before:
  - "always-multi-line"
  - ignore:
    - after-comment
    - first-nested

EmptyRule:
block-no-empty: true

FinalNewline
"@stylistic/no-missing-end-of-source-newline": true

HexLength
color-hex-length: "short"

HexNotation
@stylistic/color-hex-case: "lower"

HexValidation
color-no-invalid-hex: true

IdSelector
selector-max-id: 0

ImportPath
scss/load-no-partial-leading-underscore: true
scss/at-import-partial-extension: never

Indentation
"@stylistic/indentation": 2

LeadingZero
@stylistic/number-leading-zero: "always"

NameFormat
scss/at-function-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"
scss/at-mixin-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"
scss/dollar-variable-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"
scss/percent-placeholder-pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$"

NestingDepth
max-nesting-depth: 4

PlaceholderInExtend
scss/at-extend-no-missing-placeholder: true

PrivateNamingConvention
scss/no-unused-private-members: true

PropertySpelling
property-no-unknown: true

PseudoElement
selector-pseudo-element-colon-notation: "double"
selector-pseudo-element-no-unknown: true

SelectorDepth
selector-max-compound-selectors: 5

SelectorFormat # Not always followed; ssb-whatsapp_app
custom-property-pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
selector-class-pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$"

Shorthand
shorthand-property-no-redundant-values: true

SingleLinePerProperty
"@stylistic/declaration-block-semicolon-newline-after": always-multi-line

SingleLinePerSelector
@stylistic/selector-list-comma-newline-after": always

SpaceAfterComma
"@stylistic/value-list-comma-space-after": always

SpaceAfterPropertyColon
"@stylistic/declaration-colon-space-after": always-single-line

SpaceAfterPropertyName
"@stylistic/declaration-colon-space-before": never

SpaceAfterVariableName
scss/dollar-variable-colon-space-before: never

SpaceAroundOperator
scss/operator-no-unspaced: true

SpaceBeforeBrace
@stylistic/block-opening-brace-space-before: always

SpaceBetweenParens
"@stylistic/function-parentheses-space-inside": never
"@stylistic/selector-attribute-brackets-space-inside": never
"@stylistic/selector-pseudo-class-parentheses-space-inside": never
"@stylistic/media-feature-parentheses-space-inside": never

StringQuotes
"@stylistic/string-quotes": double

TrailingSemicolon
"@stylistic/declaration-block-trailing-semicolon": always

TrailingWhitespace # Note it was enabled by the gem and not by us
"@stylistic/no-eol-whitespace": true

TrailingZero
"@stylistic/number-no-trailing-zeros": true

UnnecessaryMantissa
"@stylistic/number-no-trailing-zeros": true

UnnecessaryParentReference
scss/selector-no-redundant-nesting-selector: true

UrlQuotes
function-url-quotes: always

VendorPrefixes
value-no-vendor-prefix: true
selector-no-vendor-prefix: true
property-no-vendor-prefix: true
at-rule-no-vendor-prefix: true
media-feature-name-no-vendor-prefix: true

ZeroUnit:
length-zero-no-unit: true
2024-04-03 14:17:53 +02:00
Javi Martín
4435673ace Move admin index to a component
This way we make it easier to modify.

Note that, since the title of the page is "Administration" and it's in
the "Admin" section, we're adding an option to the `header` method in
order to avoid having a confusing title like "Administration - Admin".

Also note that, by removing the `title` HTML class, we avoid inheriting
styles from the `dashboard.scss` stylesheet, and now the heading is
displayed in the position it was meant to.

Finally, the concept of using a `main-class` for the current page comes
from a branch (currently in development) which will replace the <div>
tag with the `admin-content` class with a `main` tag.
2023-10-16 15:06:15 +02:00
Javi Martín
959176b66d Use a darker "delete" color
The color we were using didn't have enough contrast against a white
background, which made it harder to read texts like "Remove map marker"
or "Erase my account".

Since the new color is almost identical to the color we were using on
hover and for the border, we're changing the color on hover as well,
while IMHO it's no longer necessary to use a different color for the
border.
2023-10-10 15:03:35 +02:00
Javi Martín
86fd14f8f0 Move admin header partial to a component
This way it's easier to refactor it.

Note we're using `with_request_url` in the tests because the component
renders the locale switcher, which needs a URL in order to work. This
doesn't affect whether we're in the management section or not.
2023-01-16 14:22:13 +01:00
Javi Martín
9b908d7264 Extract component to render account permissions
We were using similar code in four different places; six, if we count
the welcome pages seeds. Reducing duplication in the pages seeds is a
bit tricky because administrators are supposed to edit their content and
might remove the HTML class we use to define styles. However, we can
share the code everywhere else.

Note that there's a bug in the application since we show that level 2
users cannot vote for budget projects but we give them permission to do
so in the abilities model. We're keeping the same behavior after this
refactoring but we might change it in the future.
2022-11-29 18:48:24 +01:00
Javi Martín
a2c032573f Rename brand-text mixin to brand-color
This is consistent with the `body-colors` mixin and with other mixins
we're about to add, like `anchor-color`.
2022-11-20 00:29:12 +01:00
Javi Martín
b96d745e0e Use $body-font-color instead of $text
This is consistent with the usage of `$body-background`. This way
Foundation elements using `$body-font-color`, like the `<body>` tag,
will be changed when changing this variable, which wouldn't happen when
using `$text`.
2022-10-28 14:07:33 +02:00
Javi Martín
1b1b5b5755 Use color-pick-contrast to get text colors
We were defining (for instance) white text against the `$brand`
background. That meant that, if somebody customized the `$brand` color
so it used a light color, they had to customize the text color as well
in order to guarantee proper contrast between text and background
colors.

So we're using `color-pick-contrast` instead, which means we don't have
to manually calculate whether white or black will be the color which
makes the text more readable.
2022-10-28 13:58:04 +02:00
Javi Martín
025d7bf9f8 Remove duplication in sidebar color definition
We're going to change that code so it uses color-pick-contrast, so we're
refactoring it first.
2022-10-28 13:57:18 +02:00
Javi Martín
335f0d8bde Inherit text color instead of defining it again
This way it's easier to customize colors, particularly when links use
the same colors as the text surrounding them.

Note that the `markdown-editor-header` isn't displayed since commit
76b7f66fb, which was probably an unintended side-effect. So we're
modifying the colors here as well instead of removing the element; we
might display it again in the future.

Also note the change in `.supported` only affects the proposals section;
budget investments use a different color for the `.supported` sucess
message. Not sure whether this was originally intended or done by
accident.
2022-10-27 15:07:53 +02:00
Javi Martín
6f75069cb3 Remove unused style for table header labels
This style was added in commit 92f4c26fa. However, we don't have any
labels inside <th> elements, so we don't need it.
2022-10-26 16:23:50 +02:00
Javi Martín
7ed0dbfd9a Use the same colors for admin top-links
Doing so will help to immediately identify which administration you're
managing when using multitenant applications.

We might revert this change if we detect it causes usability issues in
the admin section.
2022-10-25 21:23:52 +02:00
Javi Martín
c30b528f5a Remove obsolete spending proposals CSS selector
This selector isn't used since commit 24dde9c35.
2022-10-13 16:05:43 +02:00
Javi Martín
ae218090f4 Remove obsolete CSS for questions geozones
This code isn't used since commit ab63c18d0.
2022-10-13 16:00:07 +02:00
Javi Martín
a08886fcf4 Remove obsolete investment-projects-list selector
It isn't used since we deleted spending proposals in commit d0b8fef6b.
2021-11-08 01:14:58 +01:00
Javi Martín
d702fbbfc7 Add a caption to headings table in budgets admin
Captions benefit blind screen reader users who navigate through tables,
particularly in this case because we potentially have several tables
with headings (one table per group), so when navigating through tables
it might be hard to know which group the headings belong to.

In this case they also benefit sighted users. Usability tests have shown
the "Groups and headings" section is a bit confusing, so adding a
caption like "Headings in Districts" helps clarifying Districts is a
group and the table refers to headings in that group.

The very same table is rendered in the "headings" step of the budget
creation wizard. However, in that case the information of the caption is
redundant because the page is specific for headings belonging to a
certain group. We're making the element invisible but still keeping it
for screen reader users in order to ease their navigation through
tables.
2021-10-25 18:34:19 +02:00
Javi Martín
7254ca333e Merge pull request #4680 from consul/small_menu_links
Increase login links touch area on small screens
2021-09-15 17:30:33 +02:00
Javi Martín
cd45607ce2 Fix focus styles in admin form controls
We lost focus styles on certain controls in commit 4dad04ae3, since we
were applying a border with a rule which had more precedence than the
rule of border on focus.
2021-09-15 13:38:36 +02:00
Javi Martín
b24994abf7 Fix styles in draft version body
There were no elements matching this selector since commit d679c1eb7 and
these styles were completely ignored. I'm re-adding the ones with make
sense in my humble opinion. I'm not adding top and bottom paddings since
they affect the way the height of the element is calculated, and am not
sure about the intention behind setting the height property.
2021-09-15 13:38:34 +02:00
Javi Martín
e2d680947a Add separator in small screen navigation
The "Sign in" or "My account" links and the main navigation are
different elements, and they're in different places on medium and large
screens. Now we're also separating them on small screens.

Since the `.vertical` class in the menu added quite a few styles and it
was difficult to overwrite them, we're simply removing this class from
this element. This way we're also removing the huge space between the
menu button and the first element of the navigation.
2021-09-12 14:20:53 +02:00
Javi Martín
4fbe2d99d5 Simplify small screen styles in admin submenu
Some of these styles were redundant and so we can remove them.
2021-09-12 14:00:42 +02:00
Javi Martín
877eb44bd4 Simplify logo layout in admin header
Having the logo inside a list of one item wasn't needed and its classes
conflicted with other elements with the `.menu` class.
2021-09-12 14:00:40 +02:00
Javi Martín
7a1acf5706 Rename proposal-form HTML class to proposal-new
So it's consistent with the proposal-edit class we use in the edit
action.
2021-07-13 15:25:31 +02:00
Javi Martín
701378d02c Add padding to the whole header
Instead of adding the padding to each individual element inside the
container, why not adding padding to the container itself? The answer is
"because we want the background of the children elements to take the
width of the whole screen". But this generates either HTML cluttered
with elements to add padding or repetitive padding definitions in the
CSS.

So now we only define the padding once, and when an element requires a
full width background or border, we use the `full-width-background`
mixin.

In this case the code is a bit more complex because the header is also
used in the dashboard and admin layouts:

* In the public layout, the body has a margin, so we include the mixin
  to take margin into account
* In the dashboard layout, the header itself has a margin, so we include
  the same mixin
* In the admin layout, the headet doesn't have a margin but gets the
  whole width, so in this case we include the mixin which dosen't take
  the margin into account

In the future, the idea is to apply this principle to the <body>
element and remove the `@include grid-column-gutter` in the CSS as well
as the `small-12 column` classes in the HTML.

Note we use the `calc()` function inside the mixin instead of using it
in the `$full-width-margin` variable. That way we avoid nested `calc()`
operations, which don't work in Internet Explorer.

Also note we're using `flex-grow: 1` to make one element appear on the
left of the screen and the other one on the right. It would be easier to
use `justify-content: space-between` (which is actually the default for
the top-bar element). However, there's a bug in Internet Explorer and
old versions of Firefox; they include the absolutely-positioned
`::before` element we use to set the full width background when
calculating where to position the elements. The bug was fixed in Firefox
52 (released in 2017).

Finally, we're removing the padding from our logo. In order to allow
logos like the new one and at the same time provide backwards
compatibility to logos in existing CONSUL installations, we're relaxing
the validation rule for the logo width.
2021-07-09 03:45:55 +02:00
Javi Martín
9cc4d52723 Use a global maximum width for the <body> element
We weren't using a global maximum width for the <body> element because
we wanted the background of some elements to cover the whole screen. If
the body didn't cover the whole screen, then we would have to find a way
to extend the background beyond the limits of the body.

Elements can take the whole screen width using a width of 100 viewport
width (vw) units, which weren't as widely supported when CONSUL
development started as they are today.

However, there's a gotcha will vw units; they don't take into account
the vertical scrollbars browsers add when scroll is needed. That means
that an element with a width of 100vw would cause a *horizontal*
scrollbar when the vertical scrollbar appears on the screen. So
approaches like this one wouldn't work:

```
body {
  margin-left: auto;
  margin-right: auto;
  max-width: $global-width;
}

@mixin full-background-width {

  &::before {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
}
```

We could add `overflow-x: hidden` to the body to avoid the horizontal
scrollbar. However, on certain screens sizes that could cause some
content to disappear if there isn't enough horizontal space for all the
elements.

If we tried some other solution based on using `max-width` with `margin:
auto` on the <body> element, it would result in a body having a fixed
width and a variable margin (depending on whether there's a scrollbar).
So it wouldn't be possible to set a negative margin on child elements
based on the margin of the body, because that margin would be different
depending on the existence of a scrollbar.

So, instead, we're adding a fixed margin to the body, which depends on
the viewport width and the font size of the <html> element. With this
approach, when a vertical scrollbar appears, the margin of the <body> is
still the same; what changes is its width. That means we can set a
negative margin on child elements based on the margin of the <body>. No
horizontal scrollbar will appear.

Note we're slightly duplicating the code by using two variables
(`$body-margin` and `$full-width-margin`) to do the same thing. We could
simply use `$body-margin` and then use `calc(-1 * #{$body-margin})` in
our `full-width-background` mixin. We aren't doing so because some old
versions of the Android browser and Internet Explorer can't handle this
operation. Since our whole layout is based on these properties, in this
case supporting old browsers is quite important.

For similar reasons we're using a breakpoint instead of using the
`max()` function like: `Max(0px, calc(50vw - #{$global-width / 2}))`. At
the time of writing, `max()` is only supported in about 91% of the
browsers.

With this change, we no longer need to add `row` elements to make sure
we don't exceed the maximum width; the <body> element takes care of
that.

Also note banners sometimes have a full background and sometimes they
don't, depending on which page they appear. We're adding specific rules
for them.

Finally, the code for full width borders is a bit brittle; sometimes we
want the border to cover an element, and sometimes we don't. For
example, we had to slightly change the way the border of the "tabs" in
legislation processes is rendered. Without these changes, the borders
wouldn't overlap as we intended. We also had to add a `z-index` to
navigation links so their bottom outline is visible when they're
focused. The recommendations have a border with the same color as the
background so it's painted on top of the border of the `help-header`
section.
2021-07-07 22:32:06 +02:00
Javi Martín
b5fd875133 Simplify border and background in admin header
Instead of defining them for all headers and then overwriting them, we
can add it just to the body of the public layout.
2021-07-07 15:10:27 +02:00
Javi Martín
366fd630dc Use $table-background to set table colors
This way it's possible to customize these colors by just changing a
variable.

The code is now quite a bit hacky; since I'm not an expert in color
design, I didn't want to change the colors we were using in case it made
the application have less appeal.

If slightly changing these colors isn't a problem, we could use
Foundation's defaults to simplify the code, maybe just changing the
`$table-color-scale` variable.
2021-06-30 16:42:54 +02:00
Javi Martín
73fe89829d Use $body-background to remove color duplication
We're using `background: #fff` and `background: $white` in many places.
Sometimes we mean "use the same background as the body", which means if
we change the body background so it's, let's say, dark, we'll also have
to change all these places.

So now we're using `$body-background` in more places, so changing the
general background color is easier.

There are still some places where we use `#fff` or `$white`. Sometimes
it's hard to tell whether the intention is "use a white background here"
or "use the same background as the body here". When in doubt, I've left
it the way it was.

Just for testing purposes, I've tested locally how things would look
like if we added this code to `_consul_custom_overrides.scss`:

```
$body-background: #fea;
$card-background: $body-background;
$tab-background: $body-background;
$tab-content-background: $body-background;
$table-background: $body-background;
```

Or:

```
$body-background: #333;
$text: #fcfcfc;
$body-font-color: $text;
$card-background: $body-background;
$tab-background: $body-background;
$tab-content-background: $body-background;
$table-background: $body-background;
```

Testing shows we've still got a long way to go to make it easy to add
custom color themes, since there are many custom colors in the code.
Hopefully these changes bring us one step closer.
2021-06-30 16:42:53 +02:00
Javi Martín
c3a329a6f6 Remove unnecessary background color definitions
These elements already inherit these background colors form their parent
elements. Defining them explicitly makes it harder to change them and it
also makes it harder to customize the styles in other CONSUL
installations.
2021-06-30 16:42:53 +02:00
Javi Martín
b2a05322fd Simplify using current color on borders
Using `currentcolor` is IMHO more expressive, since it shows the
intention of styling the border with the same color as the text.

This is particularly useful for CONSUL installations using custom
styles. Consider the following code:

```
.is-active {
  border: 1px solid $brand;
  color: $brand;
}
```

If we'd like to customize the way active items look, we'd have to
override two colors:

```
.is-active {
  border: 1px solid $brand-secondary;
  color: $brand-secondary;
}
```

Consider the scenario where we use `currentcolor` (which is the default
border color):

```
.is-active {
  border: 1px solid;
  color: $brand;
}
```

Now we only need to override one color to change the styles:

```
.is-active {
  color: $brand-secondary;
}
```
2021-06-29 20:03:36 +02:00
Javi Martín
7053b17e64 Simplify setting border on active menu elements
Since we are using the same color as the text color in both the public
and admin areas, we can omit the border color completely. Since now
admin elements get the exact same border, we can remove this border so
they'll inherit the same border as used in the public area.
2021-06-29 20:03:36 +02:00
Javi Martín
2efc307e59 Simplify changing "delete/remove" links styles
Since we're only changing the style of the border in one case and the
color in the other case, we don't have to duplicate the code for every
property.

This makes it easier for other CONSUL installations to customize these
borders.
2021-06-29 20:03:36 +02:00
Javi Martín
0c2e752932 Simplify overriding menu dropdown icon color
By default Foundation uses a `#1779ba transparent transparent`
transparent border. We were overriding the whole border, when we only
needed to override the top border. Furthermore, we were overriding it
twice: once in the public area and once in the admin area. However, if
we use `currentcolor`, we only have to override it once, and in both
cases the border will have the same color as the text surrounding it
(white in the public area and black in the admin area).
2021-06-29 20:03:36 +02:00
Javi Martín
e6c1cf7743 Simplify colors in admin header
Not that we've simplified the top bar colors, we can just use a
transparent header to get the same background as the body.
2021-06-29 19:45:09 +02:00
Javi Martín
8e8a4d784c Simplify using text color for links
Using `inherit` is IMHO more expressive since it means "use the color of
the parent element".

This is particularly useful for CONSUL installations using custom
styles. Consider the following code:

```
h2 {
  color: $white;

  a {
    color: $white;
  }
}
```

If we'd like to customize the way headings look, we'd have to override
two colors:

```
h2 {
  color: $red;

  a {
    color: $red;
  }
}
```

Consider the scenario where we use `inherit`:

```
h2 {
  color: $white;

  a {
    color: inherit;
  }
}
```

Now we only need to override one color to change the styles:

```
h2 {
  color: $red;
}
```
2021-06-29 19:45:09 +02:00
Javi Martín
bc7005aeef Simplify dropdown menu colors
Using `inherit` we don't have to overwrite the styles in the admin menu.
2021-06-29 19:45:09 +02:00
Javi Martín
7d8a64cb1f Remove unused poll table styles
These styles aren't used since commit 6f324c693.
2021-06-29 19:41:58 +02:00
Javi Martín
c67fc8a814 Remove unused CSS for verified organizations
It isn't used since commit f17d0a663.
2021-06-29 19:41:58 +02:00
Javi Martín
d45bf4d5da Remove redundant menu link colors
The color is inherited from the `.top-bar .menu > li a` selector.
2021-06-29 19:41:58 +02:00
Javi Martín
41235f9f02 Remove obsolete menu-text styles
Since commit dcec003d0 we're only using the menu-text class in the admin
layouts. So instead of defining styles for menu-text and then
overwriting them in the admin section, we can define them just in the
admin section.

Since we don't have <img> tags in the menu-text element in the admin
section, we can remove their styles. And we can also remove the styles
we were overriding twice (like `line-height`).
2021-06-29 19:41:58 +02:00
Javi Martín
bc0f040758 Use order links in legislation proposals admin
As mentioned in the previous commits, a `<select>` field which submits
its form on change causes many accessibility and usability issues, so
we're replacing it with the order links we use everywhere else.

Since the links "Id" and "Title" by themselves don't have enough
information to let users know they're used to sort by ID or title, we
have to update them somehow. We could add a "Sort by:" prefix before the
list of links (and associate it with the `aria-labelledby` attribute);
however, we don't do this anywhere else and might look weird depending
on the screen size.

So we're simply adding "Sort by" before each link.

Now that we don't use the `wide_order_selector` partial anymore, we can
remove it alongside the styles for the `select-order` class.
2021-06-28 01:20:39 +02:00
Javi Martín
227a5868b8 Use order links in moderation section
Using order links in this case causes an unusual interface, where we
show filter links, then information about the number of results, and
then order links.

Whether or not this makes sense needs to be confirmed with usability
tests. In any case, this is still way better than using `<select>`
fields which automatically change to a new page, since they cause
problems to keyboard users, are harder to select for touchscreen users,
might confuse screen reader users who will notice a form but no way to
submit it, and are not elements we generally use to let users choose the
order of the records.

For a more detailed explanation of these issues, check the commit
message in the commit "Use order links to sort comments and topics"
(just a few commits ago).
2021-06-28 00:15:08 +02:00
Javi Martín
125f0bc73a Fix font size on column selector label
It was duplicating the `$base-font-size` value, and it was using pixels
as a unit, which we only use in the `$base-font-size` variable.
2021-06-17 01:41:40 +02:00
Javi Martín
7f38f61bc1 Merge pull request #4539 from consul/system_emails_preview
Fix custom system emails preview
2021-06-16 12:25:15 +02:00