Matched figma padding

This commit is contained in:
zandercymatics 2023-08-25 09:34:01 -06:00
parent 81e5f5f8bb
commit 7fafecab0a
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
7 changed files with 50 additions and 36 deletions

View file

@ -211,7 +211,7 @@ function handleValidationClick(e) {
* An IIFE that will attach validators to inputs.
*
* It looks for elements with `validate="<type> <type>"` and adds change handlers.
*
*
* These handlers know about two other attributes:
* - `validate-for="<id>"` creates a button which will run the validator(s) on <id>
* - `auto-validate` will run validator(s) when the user stops typing (otherwise,

View file

@ -1,7 +1,7 @@
@use "cisa_colors" as *;
@use "uswds-core" as *;
// We'll use Django's CSS vars: https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#theming-support
// We'll use Django's CSS vars: https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#theming-support
// and assign USWDS theme vars whenever possible
// If needed (see below), we'll use the USWDS hex value
// As a last resort, we'll use CISA colors to supplement the palette
@ -72,34 +72,34 @@ html[data-theme="light"] {
@media (prefers-color-scheme: dark) {
:root,
html[data-theme="dark"] {
// Edit the primary to meet accessibility requ.
// Edit the primary to meet accessibility requ.
--primary: #23485a;
--primary-fg: #f7f7f7;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
@ -108,7 +108,7 @@ html[data-theme="light"] {
.change-list .usa-table,
.change-list .usa-table--striped tbody tr:nth-child(odd) td,
.change-list .usa-table--borderless thead th,
.change-list .usa-table thead td,
.change-list .usa-table thead td,
.change-list .usa-table thead th,
body.dashboard,
body.change-list,
@ -122,7 +122,7 @@ html[data-theme="dark"] {
.change-list .usa-table,
.change-list .usa-table--striped tbody tr:nth-child(odd) td,
.change-list .usa-table--borderless thead th,
.change-list .usa-table thead td,
.change-list .usa-table thead td,
.change-list .usa-table thead th,
body.dashboard,
body.change-list,
@ -163,7 +163,7 @@ table > caption > a {
height: auto!important;
}
// Keep th from collapsing
// Keep th from collapsing
.min-width-25 {
min-width: 25px;
}

View file

@ -26,7 +26,6 @@ $letter-space--xs: .0125em;
@use "uswds-core" as *;
/* Styles for making visible to screen reader / AT users only. */
.sr-only {
@include sr-only;
}
@ -62,9 +61,9 @@ body {
}
p,
address,
.usa-list li {
@include typeset('sans', 'sm', 5);
address,
.usa-list li {
@include typeset('sans', 'sm', 5);
max-width: measure(5);
}
@ -119,7 +118,7 @@ h2 {
color: color('violet-70v'); //USWDS default
}
}
.register-form-step .usa-form-group:first-of-type,
.register-form-step .usa-form-group:first-of-type,
.register-form-step .usa-label:first-of-type {
margin-top: units(1);
}
@ -181,7 +180,7 @@ a.withdraw:active {
a.link_usa-checked {
padding: 0;
}
}
}
}
}
@ -243,7 +242,7 @@ a.withdraw:active {
.usa-form .usa-button {
margin-top: units(3);
}
}
.usa-button--unstyled .usa-icon {
vertical-align: bottom;
@ -396,7 +395,7 @@ a.usa-button--unstyled:visited {
}
.dotgov-status-box {
background-color: color('primary-lightest');
background-color: color('primary-lightest');
border-color: color('accent-cool-lighter');
}
@ -441,3 +440,13 @@ abbr[title] {
font-size: units(3);
}
}
// The icon was off center for some reason
// Fixes that issue
@media (min-width: 64em){
.usa-alert--warning{
.usa-alert__body::before {
left: 1rem !important;
}
}
}

View file

@ -23,7 +23,7 @@
<main id="main-content" class="grid-container">
{% if is_analyst_or_superuser and analyst_action == 'edit' and analyst_action_location == domain.pk %}
<div class="usa-alert usa-alert--warning">
<div class="usa-alert usa-alert--warning margin-bottom-2">
<div class="usa-alert__body">
<h4 class="usa-alert__heading larger-font-sizing">Attention!</h4>
<p class="usa-alert__text ">

View file

@ -4,8 +4,8 @@
<nav aria-label="Domain sections">
<ul class="usa-sidenav">
<li class="usa-sidenav__item">
{% url 'domain' pk=domain.id as url %}
<a href="{{ url }}"
{% url 'domain' pk=domain.id as url %}
<a href="{{ url }}"
{% if request.path == url %}class="usa-current"{% endif %}
>
Domain overview
@ -13,7 +13,7 @@
</li>
<li class="usa-sidenav__item">
{% url 'domain-nameservers' pk=domain.id as url %}
{% url 'domain-nameservers' pk=domain.id as url %}
<a href="{{ url }}"
{% if request.path == url %}class="usa-current"{% endif %}
>
@ -28,7 +28,7 @@
>
Organization name and mailing address
</a>
</li>
</li>
<li class="usa-sidenav__item">
{% url 'domain-authorizing-official' pk=domain.id as url %}

View file

@ -2,7 +2,12 @@
from django.contrib.auth.mixins import PermissionRequiredMixin
from registrar.models import DomainApplication, DomainInvitation, DomainInformation, UserDomainRole
from registrar.models import (
DomainApplication,
DomainInvitation,
DomainInformation,
UserDomainRole,
)
import logging
logger = logging.getLogger(__name__)
@ -71,11 +76,10 @@ class DomainPermission(PermissionsLoginMixin):
session = self.request.session
# Check if the user is attempting a valid edit action.
# If analyst_action is present, analyst_action_location will be present.
# if it isn't, then it either suggests tampering
# or a larger omnipresent issue with sessions.
can_do_action = (
"analyst_action" in session and session["analyst_action_location"] == pk
"analyst_action" in session
and "analyst_action_location" in session
and session["analyst_action_location"] == pk
)
# If the valid session keys exist, if the user is permissioned,

View file

@ -34,14 +34,15 @@ class DomainPermissionView(DomainPermission, DetailView, abc.ABC):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
user = self.request.user
context["is_analyst_or_superuser"] = user.is_staff or user.is_superuser
# Stored in a variable for the linter
action = "analyst_action"
action_location = "analyst_action_location"
# Flag to see if an analyst is attempting to make edits
if "analyst_action" in self.request.session:
# Stored in a variable for the linter
action = "analyst_action"
if action in self.request.session:
context[action] = self.request.session[action]
context[f"{action}_location"] = self.request.session[f"{action}_location"]
if action_location in self.request.session:
context[action_location] = self.request.session[action_location]
return context